From: Aleksander Ɓukasz Date: Tue, 16 Jul 2013 14:35:49 +0000 (+0200) Subject: Reacting to wlxml class change in helper modules properly X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/a72a2ac218147b7c6874fbdc361d0a3fb6532a88?ds=inline Reacting to wlxml class change in helper modules properly --- diff --git a/modules/documentCanvas/documentCanvas.js b/modules/documentCanvas/documentCanvas.js index dbbbd0e..4cf3558 100644 --- a/modules/documentCanvas/documentCanvas.js +++ b/modules/documentCanvas/documentCanvas.js @@ -56,6 +56,7 @@ return function(sandbox) { } else { currentNodeElement.setWlxmlMetaAttr(attr, value); } + sandbox.publish('currentNodeElementChanged', currentNodeElement); }, highlightElement: function(element) { canvas.highlightElement(element); diff --git a/modules/nodeBreadCrumbs/nodeBreadCrumbs.js b/modules/nodeBreadCrumbs/nodeBreadCrumbs.js index 9bf211e..34e514a 100644 --- a/modules/nodeBreadCrumbs/nodeBreadCrumbs.js +++ b/modules/nodeBreadCrumbs/nodeBreadCrumbs.js @@ -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); } diff --git a/modules/rng/rng.js b/modules/rng/rng.js index a3e746c..1ecdc4e 100644 --- a/modules/rng/rng.js +++ b/modules/rng/rng.js @@ -205,6 +205,10 @@ return function(sandbox) { commands.updateCurrentNodeElement(nodeElement); }, + currentNodeElementChanged: function(nodeElement) { + commands.updateCurrentNodeElement(nodeElement); + }, + contentChanged: function() { dirty.documentCanvas = true; },