fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
editor: show comment tip next to blocks containing comments
[fnpeditor.git]
/
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
(file)
--- 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._container().append(el.dom);
}
}.bind(this));
+
+ this.commentTip = $('<div class="comment-tip"><i class="icon-comment"></i></div>');
+ this.addWidget(this.commentTip);
+
+ if(!this.wlxmlNode.hasChild({klass: 'comment'})) {
+ this.commentTip.hide();
+ }
+
this.refresh();
},
this.refresh();
},
@@
-119,8
+127,13
@@
$.extend(generic, {
}
referenceElement[referenceAction](actionArg);
}
referenceElement[referenceAction](actionArg);
+
+ if(event.meta.node.is('comment')) {
+ this.commentTip.show();
+ }
},
onNodeDetached: function(event) {
},
onNodeDetached: function(event) {
+ var isComment = event.meta.node.is('comment');
if(event.meta.node.sameNode(this)) {
this.detach();
} else {
if(event.meta.node.sameNode(this)) {
this.detach();
} else {
@@
-130,6
+143,9
@@
$.extend(generic, {
return true;
}
});
return true;
}
});
+ if(isComment && !this.wlxmlNode.hasChild({klass: 'comment'})) {
+ this.commentTip.hide();
+ }
}
},
onNodeTextChange: function(event) {
}
},
onNodeTextChange: function(event) {