Fixing selection of a new node after insert
[fnpeditor.git] / modules / nodeBreadCrumbs / nodeBreadCrumbs.js
index cefe7b4..517f45b 100644 (file)
@@ -31,6 +31,7 @@ return function(sandbox) {
         setNode: function(node) {\r
             this.dom.empty();\r
             var nodes = this.nodes = {};\r
+            this.currentNode = node;\r
             this.nodes[node.id] = node;\r
             var parents = node.parents();\r
             parents.each(function() {\r
@@ -53,7 +54,11 @@ return function(sandbox) {
     return {\r
         start: function() { sandbox.publish('ready'); },\r
         getView: function() { return view.dom; },\r
-        setNode: function(node) { view.setNode(node); },\r
+        setNode: function(wlxmlNode) {\r
+            if(!wlxmlNode.is(view.currentNode)) {\r
+                view.setNode(wlxmlNode);\r
+            }\r
+        },\r
         highlightNode: function(id) { view.highlightNode(id); },\r
         dimNode: function(id) { view.dimNode(id); }\r
     }\r