X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/d8c1b8422ef879e737e05f60f7ac401af31b6049..fa35a2ccd01eccad357d79258de134a4e0f9d6ea:/src/editor/modules/documentCanvas/canvas/genericElement.js
diff --git a/src/editor/modules/documentCanvas/canvas/genericElement.js b/src/editor/modules/documentCanvas/canvas/genericElement.js
index 8d0ba87..4f4da9b 100644
--- a/src/editor/modules/documentCanvas/canvas/genericElement.js
+++ b/src/editor/modules/documentCanvas/canvas/genericElement.js
@@ -31,6 +31,14 @@ $.extend(generic, {
this._container().append(el.dom);
}
}.bind(this));
+
+ this.commentTip = $('
');
+ this.addWidget(this.commentTip);
+
+ if(!this.wlxmlNode.hasChild({klass: 'comment'})) {
+ this.commentTip.hide();
+ }
+
this.refresh();
},
@@ -119,8 +127,13 @@ $.extend(generic, {
}
referenceElement[referenceAction](actionArg);
+
+ if(event.meta.node.is('comment')) {
+ this.commentTip.show();
+ }
},
onNodeDetached: function(event) {
+ var isComment = event.meta.node.is('comment');
if(event.meta.node.sameNode(this)) {
this.detach();
} else {
@@ -130,6 +143,9 @@ $.extend(generic, {
return true;
}
});
+ if(isComment && !this.wlxmlNode.hasChild({klass: 'comment'})) {
+ this.commentTip.hide();
+ }
}
},
onNodeTextChange: function(event) {