mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-12-22 19:53:49 +01:00
Fix node text edition error
This commit is contained in:
parent
f95e65f21b
commit
b2310e53fc
@ -92,8 +92,8 @@ class MultilineTextEditor extends Events {
|
||||
break;
|
||||
case 'tab':
|
||||
event.preventDefault();
|
||||
var start = $(this).get(0).selectionStart;
|
||||
var end = $(this).get(0).selectionEnd;
|
||||
const start = $(this).get(0).selectionStart;
|
||||
const end = $(this).get(0).selectionEnd;
|
||||
|
||||
// set textarea value to: text before caret + tab + text after caret
|
||||
$(this).val(`${$(this).val().substring(0, start)}\t${$(this).val().substring(end)}`);
|
||||
@ -101,6 +101,9 @@ class MultilineTextEditor extends Events {
|
||||
// put caret at right position again
|
||||
$(this).get(0).selectionStart = $(this).get(0).selectionEnd = start + 1;
|
||||
break;
|
||||
default:
|
||||
// No actions...
|
||||
break;
|
||||
}
|
||||
event.stopPropagation();
|
||||
});
|
||||
@ -192,8 +195,9 @@ class MultilineTextEditor extends Events {
|
||||
font.color = nodeText.getColor();
|
||||
this._setStyle(font);
|
||||
const me = this;
|
||||
|
||||
// Set editor's initial size
|
||||
const displayFunc = function () {
|
||||
const displayFunc = function displayFunc() {
|
||||
// Position the editor and set the size...
|
||||
const textShape = topic.getTextShape();
|
||||
|
||||
@ -212,7 +216,7 @@ class MultilineTextEditor extends Events {
|
||||
me._positionCursor(inputElem, !$defined(defaultText));
|
||||
};
|
||||
|
||||
this._timeoutId = displayFunc.delay(10);
|
||||
this._timeoutId = setTimeout(() => displayFunc(), 10);
|
||||
}
|
||||
|
||||
_setStyle(fontStyle) {
|
||||
|
Loading…
Reference in New Issue
Block a user