X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/ef0f264a9a385985afb67cb533cc720787b757fd..1038a12a841bbacec60cd8a73a93ecf1658ea8a5:/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 d3debb2..4dfbe59 100644 --- a/src/editor/modules/documentCanvas/canvas/genericElement.js +++ b/src/editor/modules/documentCanvas/canvas/genericElement.js @@ -33,7 +33,7 @@ $.extend(generic, { } }.bind(this)); - this.commentsView = new CommentsView(this.wlxmlNode, {}); + this.commentsView = new CommentsView(this.wlxmlNode, this.canvas.metadata.user); this.addToGutter(this.commentsView); this.commentTip = $('
'); this.addWidget(this.commentTip); @@ -80,13 +80,18 @@ $.extend(generic, { return toret; }, - getVerticallyFirstTextElement: function() { + getVerticallyFirstTextElement: function(params) { var toret; + + params = _.extend({ + considerChildren: true + }, params); + this.children().some(function(child) { if(child instanceof documentElement.DocumentTextElement) { toret = child; return true; // break - } else { + } else if(params.considerChildren) { toret = child.getVerticallyFirstTextElement(); if(toret) { return true; // break