1
0
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:
Toby Zerner 2015-06-01 08:49:46 +09:30
parent f8d681d9ab
commit 1153e41b7a

View File

@ -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();