- .attr('wlxml-tag', this.wlxmlNode.getTagName());
- this.setWlxmlClass(this.wlxmlNode.getClass());
- this.wlxmlNode.contents().forEach(function(node) {
- var el = this.canvas.createElement(node);
- if(el.dom) {
- this._container().append(el.dom);
- }
- }.bind(this));
+ .attr('wlxml-tag', this.wlxmlNode.getTagName())
+ .attr('wlxml-class', this.wlxmlNode.getClass().replace(/\./g, '-'));
+
+ 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();
+ }
+