X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/2e14f0181735b7acd0da023eb4c9524b75a45b56..869d237d2f1675068423f664f13ce5b0f8707218:/src/editor/modules/documentCanvas/canvas/documentElement.js diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index 99e97d0..e374a86 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -102,7 +102,7 @@ $.extend(DocumentNodeElement.prototype, { contentContainer = $('
') .attr('document-element-content', ''); - wrapper.append(widgetsContainer, contentContainer); + wrapper.append(contentContainer, widgetsContainer); widgetsContainer.find('*').add(widgetsContainer).attr('tabindex', -1); return wrapper; }, @@ -133,6 +133,8 @@ $.extend(DocumentNodeElement.prototype, { this.toggleHighlight(toggle); }, + markAsCurrent: function() {}, + toggleHighlight: function(toggle) { this._container().toggleClass('highlighted-element', toggle); }, @@ -190,7 +192,12 @@ $.extend(DocumentTextElement.prototype, { return this; }, setText: function(text) { - this.dom.contents()[0].data = text; + if(text === '') { + text = utils.unicode.ZWS; + } + if(text !== this.getText()) { + this.dom.contents()[0].data = text; + } }, getText: function(options) { options = _.extend({raw: false}, options || {});