mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 17:22:46 +08:00
Add text-editor API to get selection range
This commit is contained in:
parent
78efdc1d09
commit
605eaa6ffc
|
@ -61,6 +61,11 @@ export default class TextEditor extends Component {
|
|||
$textarea.focus();
|
||||
}
|
||||
|
||||
getSelectionRange() {
|
||||
var $textarea = this.$('textarea');
|
||||
return [$textarea[0].selectionStart, $textarea[0].selectionEnd];
|
||||
}
|
||||
|
||||
insertAtCursor(insert) {
|
||||
var textarea = this.$('textarea')[0];
|
||||
var content = this.value();
|
||||
|
|
Loading…
Reference in New Issue
Block a user