From: Aleksander Ɓukasz Date: Thu, 6 Jun 2013 11:18:17 +0000 (+0200) Subject: Highlighting nodes in nodeFamilyTree X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/f8b3ddf413bc700b6c640a0da368b3a1a41c09cc?ds=sidebyside;hp=b58b8f498d9b5e70aec099829b97af2c4d72da10 Highlighting nodes in nodeFamilyTree --- diff --git a/modules/nodeFamilyTree/nodeFamilyTree.js b/modules/nodeFamilyTree/nodeFamilyTree.js index 68ab8f0..bd9c42c 100644 --- a/modules/nodeFamilyTree/nodeFamilyTree.js +++ b/modules/nodeFamilyTree/nodeFamilyTree.js @@ -55,6 +55,12 @@ return function(sandbox) { }, getView: function() { return view.dom; + }, + highlightNode: function(id) { + view.dom.find('a[data-id="'+id+'"]').addClass('rng-hover'); + }, + dimNode: function(id) { + view.dom.find('a[data-id="'+id+'"]').removeClass('rng-hover'); } }; }; diff --git a/modules/rng/rng.js b/modules/rng/rng.js index 09e1b90..a48535c 100644 --- a/modules/rng/rng.js +++ b/modules/rng/rng.js @@ -112,11 +112,11 @@ return function(sandbox) { }, nodeHovered: function(node) { - + sandbox.getModule('nodeFamilyTree').highlightNode(node.attr('id')); }, nodeBlured: function(node) { - + sandbox.getModule('nodeFamilyTree').dimNode(node.attr('id')); } };