From a287eed34e6c59d08ece25f89b05ad4bfc182835 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Mon, 22 Apr 2013 15:34:45 +0200 Subject: [PATCH] Visual editor - fixing cross highlighting Don't add rng-hover class to node representation in editor pane while hovering on it. --- modules/visualEditor.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/visualEditor.js b/modules/visualEditor.js index 4c8af20..b03b14b 100644 --- a/modules/visualEditor.js +++ b/modules/visualEditor.js @@ -15,8 +15,8 @@ rng.modules.visualEditor = function(sandbox) { isDirty = true; }); - this.node.on('mouseover', '[wlxml-tag]', function(e) { view.highlightNode($(e.target));}); - this.node.on('mouseout', '[wlxml-tag]', function(e) { view.dimNode($(e.target));}); + this.node.on('mouseover', '[wlxml-tag]', function(e) { mediator.nodeHovered($(e.target));}); + this.node.on('mouseout', '[wlxml-tag]', function(e) { mediator.nodeBlured($(e.target));}); this.node.on('click', '[wlxml-tag]', function(e) { console.log('clicked node type: '+e.target.nodeType); view._markSelected($(e.target)); @@ -141,11 +141,9 @@ rng.modules.visualEditor = function(sandbox) { }, highlightNode: function(node) { node.addClass('rng-hover'); - mediator.nodeHighlighted(node); }, dimNode: function(node) { node.removeClass('rng-hover'); - mediator.nodeDimmed(node); }, highlightNodeById: function(id) { var node = this.node.find('#'+id); @@ -292,10 +290,12 @@ rng.modules.visualEditor = function(sandbox) { nodeDimmedById: function(id) { view.dimNodeById(id); }, - nodeHighlighted: function(node) { + nodeHovered: function(node) { + view.highlightNode(node); sideBarView.highlightNode(node.attr('id')); }, - nodeDimmed: function(node) { + nodeBlured: function(node) { + view.dimNode(node); sideBarView.dimNode(node.attr('id')); } } -- 2.20.1