isDirty = true;\r
});\r
- this.node.on('mouseover', '[wlxml-tag]', function(e) { $(e.target).addClass('rng-hover')});\r
- this.node.on('mouseout', '[wlxml-tag]', function(e) { $(e.target).removeClass('rng-hover')});\r
+ this.node.on('mouseover', '[wlxml-tag]', function(e) { view.highlightNode($(e.target));});\r
+ this.node.on('mouseout', '[wlxml-tag]', function(e) { view.dimNode($(e.target));});\r
this.node.on('click', '[wlxml-tag]', function(e) {\r
console.log('clicked node type: '+e.target.nodeType);\r
view._markSelected($(e.target));\r
if(node)\r
this.selectNode(node);\r
},\r
+ highlightNode: function(node) {\r
+ node.addClass('rng-hover');\r
+ mediator.nodeHighlighted(node);\r
+ },\r
+ dimNode: function(node) {\r
+ node.removeClass('rng-hover');\r
+ mediator.nodeDimmed(node);\r
+ },\r
+ highlightNodeById: function(id) {\r
+ var node = this.node.find('#'+id);\r
+ if(node)\r
+ this.highlightNode(node);\r
+ },\r
+ dimNodeById: function(id) {\r
+ var node = this.node.find('#'+id);\r
+ if(node)\r
+ this.dimNode(node);\r
+ },\r
selectFirstNode: function() {\r
var firstNodeWithText = this.node.find('[wlxml-tag]').filter(function() {\r
return $(this).clone().children().remove().end().text().trim() !== '';\r
\r
view.node.on('click', '.rng-visualEditor-editPaneSurrouding a', function(e) {\r
var target = $(e.target);\r
+ mediator.nodeDimmedById(target.attr('data-id'));\r
mediator.nodeSelectedById(target.attr('data-id'));\r
});\r
+ \r
+ view.node.on('mouseenter', '.rng-visualEditor-editPaneSurrouding a', function(e) {\r
+ var target = $(e.target);\r
+ mediator.nodeHighlightedById(target.attr('data-id')); \r
+ });\r
+ view.node.on('mouseleave', '.rng-visualEditor-editPaneSurrouding a', function(e) {\r
+ var target = $(e.target);\r
+ mediator.nodeDimmedById(target.attr('data-id')); \r
+ });\r
},\r
selectTab: function(id) {\r
this.node.find('.rng-visualEditor-sidebarContentItem').hide();\r
});\r
var naviTemplate = sandbox.getTemplate('editPaneNavigation')({parent: parent, children: children});\r
pane.find('.rng-visualEditor-editPaneSurrouding > div').html($(naviTemplate));\r
+ },\r
+ highlightNode: function(id) {\r
+ var pane = this.node.find('#rng-visualEditor-edit');\r
+ pane.find('a[data-id="'+id+'"]').addClass('rng-hover');\r
+ },\r
+ dimNode: function(id) {\r
+ var pane = this.node.find('#rng-visualEditor-edit');\r
+ pane.find('a[data-id="' +id+'"]').removeClass('rng-hover');\r
}\r
}\r
\r
},\r
nodeSelectedById: function(id) {\r
view.selectNodeById(id);\r
+ },\r
+ nodeHighlightedById: function(id) {\r
+ view.highlightNodeById(id);\r
+ },\r
+ nodeDimmedById: function(id) {\r
+ view.dimNodeById(id);\r
+ },\r
+ nodeHighlighted: function(node) {\r
+ sideBarView.highlightNode(node.attr('id'));\r
+ },\r
+ nodeDimmed: function(node) {\r
+ sideBarView.dimNode(node.attr('id'));\r
}\r
}\r
\r