All of this logic is now handled properly at the wlxml.js level and
Canvas reacts accordingly through document events handling.
return this.dom().children('[document-element-content]');
},
detach: function() {
return this.dom().children('[document-element-content]');
},
detach: function() {
- var parent = this.parent();
- if(!parent)
- return;
-
- var parentChildren = parent.children(),
- myIdx = parent.childIndex(this);
-
- if(myIdx > 0 && myIdx < parentChildren.length) {
- if((parentChildren[myIdx-1] instanceof DocumentTextElement) && (parentChildren[myIdx+1] instanceof DocumentTextElement)) {
- parentChildren[myIdx-1].appendText(parentChildren[myIdx+1].getText());
- parentChildren[myIdx+1].detach();
- }
- }
this.dom().detach();
this.canvas = null;
return this;
this.dom().detach();
this.canvas = null;
return this;