- if(nodeIndex === 0) {
- referenceElement = this;
- referenceAction = 'prepend';
- } else {
- referenceElement = this.children()[nodeIndex-1];
- referenceAction = 'after';
+ this.container = this.createContainer(this.wlxmlNode.contents(), {
+ manages: function(node) { return !node.isInside('comment'); },
+ dom: this._container()
+ });
+
+ this.commentsView = new CommentsView(this.wlxmlNode, this.canvas.metadata.user);
+ this.addToGutter(this.commentsView);
+ 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();