X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/5be499ab63f91b65065fe34f3a6d645efc9ae7b6..8bf6c2bb6ef0a358a3591d19d6aff7a1f7f22b92:/modules/nodeBreadCrumbs/nodeBreadCrumbs.js diff --git a/modules/nodeBreadCrumbs/nodeBreadCrumbs.js b/modules/nodeBreadCrumbs/nodeBreadCrumbs.js index cefe7b4..c147c09 100644 --- a/modules/nodeBreadCrumbs/nodeBreadCrumbs.js +++ b/modules/nodeBreadCrumbs/nodeBreadCrumbs.js @@ -31,11 +31,12 @@ return function(sandbox) { setNode: function(node) { this.dom.empty(); var nodes = this.nodes = {}; - this.nodes[node.id] = node; + this.currentNode = node; + this.nodes[node.getId()] = node; var parents = node.parents(); parents.each(function() { var parent = this; - nodes[parent.id] = parent; + nodes[parent.getId()] = parent; }); this.dom.html(template({node: node, parents: parents})); }, @@ -53,7 +54,11 @@ return function(sandbox) { return { start: function() { sandbox.publish('ready'); }, getView: function() { return view.dom; }, - setNode: function(node) { view.setNode(node); }, + setNode: function(canvasNode) { + if(!canvasNode.isSame(view.currentNode)) { + view.setNode(canvasNode); + } + }, highlightNode: function(id) { view.highlightNode(id); }, dimNode: function(id) { view.dimNode(id); } }