Reacting to wlxml class change in helper modules properly
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 16 Jul 2013 14:35:49 +0000 (16:35 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 16 Jul 2013 14:35:49 +0000 (16:35 +0200)
modules/documentCanvas/documentCanvas.js
modules/nodeBreadCrumbs/nodeBreadCrumbs.js
modules/rng/rng.js

index dbbbd0e..4cf3558 100644 (file)
@@ -56,6 +56,7 @@ return function(sandbox) {
             } else {
                 currentNodeElement.setWlxmlMetaAttr(attr, value);
             }
+            sandbox.publish('currentNodeElementChanged', currentNodeElement);
         },
         highlightElement: function(element) {
             canvas.highlightElement(element);
index 9bf211e..34e514a 100644 (file)
@@ -54,9 +54,7 @@ return function(sandbox) {
         start: function() { sandbox.publish('ready'); },
         getView: function() { return view.dom; },
         setNodeElement: function(nodeElement) {
-            if(!nodeElement.sameNode(view.currentNodeElement)) {
-                view.setNodeElement(nodeElement);
-            }
+            view.setNodeElement(nodeElement);
         },
         highlightNode: function(id) { view.highlightNode(id); },
         dimNode: function(id) { view.dimNode(id); }
index a3e746c..1ecdc4e 100644 (file)
@@ -205,6 +205,10 @@ return function(sandbox) {
             commands.updateCurrentNodeElement(nodeElement);
         },
         
+        currentNodeElementChanged: function(nodeElement) {
+            commands.updateCurrentNodeElement(nodeElement);
+        },
+
         contentChanged: function() {
             dirty.documentCanvas = true;
         },