mirror of
https://github.com/flarum/core.git
synced 2025-02-25 19:53:48 +01:00
Add text-editor API to get selection range
This commit is contained in:
parent
f8d681d9ab
commit
1153e41b7a
@ -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…
x
Reference in New Issue
Block a user