X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/436728b375888873e6e96079a73f12d8adbd7b96..29a9bfd9b61771b41ca18de2a53b672cb3c07cf1:/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 a08788b..45592ef 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;
},
@@ -112,7 +112,6 @@ $.extend(DocumentNodeElement.prototype, {
detach: function() {
var parents = this.parents();
this.dom.detach();
- this.canvas = null;
if(parents[0]) {
parents[0].refreshPath();
}
@@ -133,6 +132,8 @@ $.extend(DocumentNodeElement.prototype, {
this.toggleHighlight(toggle);
},
+ markAsCurrent: function() {},
+
toggleHighlight: function(toggle) {
this._container().toggleClass('highlighted-element', toggle);
},
@@ -186,21 +187,16 @@ $.extend(DocumentTextElement.prototype, {
},
detach: function() {
this.dom.detach();
- this.canvas = null;
return this;
},
- handle: function(event) {
- var toSet = event.meta.node.getText();
- if(toSet === '') {
- toSet = utils.unicode.ZWS;
+ setText: function(text) {
+ if(text === '') {
+ text = utils.unicode.ZWS;
}
- if(toSet !== this.getText()) {
- this.setText(toSet);
+ if(text !== this.getText()) {
+ this.dom.contents()[0].data = text;
}
},
- setText: function(text) {
- this.dom.contents()[0].data = text;
- },
getText: function(options) {
options = _.extend({raw: false}, options || {});
var toret = this.dom.text();