if(mutation.target.data === '') {
mutation.target.data = utils.unicode.ZWS;
}
- else if(mutation.oldValue === utils.unicode.ZWS) {
+ if(mutation.target.data === mutation.oldValue) {
+ return; // shouldn't happen, but better be safe
+ }
+ if(mutation.oldValue === utils.unicode.ZWS) {
mutation.target.data = mutation.target.data.replace(utils.unicode.ZWS, '');
canvas._moveCaretToTextElement(canvas.getDocumentElement(mutation.target), 'end');
}
if(text === '') {
text = utils.unicode.ZWS;
}
- if(text !== this.getText()) {
+ if(text !== this.dom.contents()[0].data) {
this.dom.contents()[0].data = text;
}
},
element = s.canvas.getNearestTextElement('below', s.element);
}
+ e.preventDefault();
+
if(!element) {
return;
}
-
var parent = element.wlxmlNode.parent();
if(element.wlxmlNode.getIndex() === 0 && parent.isContextRoot() && (!parent.is('item') || parent.getIndex() === 0)) {
// Don't even try to do anything at the edge of a context root, except for non-first items
return;
}
- e.preventDefault();
-
s.canvas.wlxmlDocument.transaction(function() {
if(element.wlxmlNode.getIndex() === 0) {
goto = element.wlxmlNode.parent().moveUp();