Allowing grid toggle event if no node selected
[fnpeditor.git] / modules / rng / rng.js
index 469a6fc..d773c30 100644 (file)
@@ -64,10 +64,12 @@ return function(sandbox) {
         },
         selectNode: function(canvasNode, origin) {
             sandbox.getModule('documentCanvas').selectNode(canvasNode);
         },
         selectNode: function(canvasNode, origin) {
             sandbox.getModule('documentCanvas').selectNode(canvasNode);
+            this.updateNodesModules(canvasNode);           
+        },
+        updateNodesModules: function(canvasNode) {
             sandbox.getModule('nodePane').setNode(canvasNode);
             sandbox.getModule('nodeFamilyTree').setNode(canvasNode);
             sandbox.getModule('nodeBreadCrumbs').setNode(canvasNode);
             sandbox.getModule('nodePane').setNode(canvasNode);
             sandbox.getModule('nodeFamilyTree').setNode(canvasNode);
             sandbox.getModule('nodeBreadCrumbs').setNode(canvasNode);
-            
         },
         resetDocument: function(document, reason) {
             var modules = [];
         },
         resetDocument: function(document, reason) {
             var modules = [];
@@ -199,6 +201,10 @@ return function(sandbox) {
             dirty.documentCanvas = true;
         },
         
             dirty.documentCanvas = true;
         },
         
+        currentNodeChanged: function(canvasNode) {
+            commands.updateNodesModules(canvasNode);
+        },
+
         nodeHovered: function(canvasNode) {
             commands.highlightDocumentNode(canvasNode);
         },
         nodeHovered: function(canvasNode) {
             commands.highlightDocumentNode(canvasNode);
         },
@@ -250,14 +256,8 @@ return function(sandbox) {
         ready: function() {
             views.visualEditing.setView('toolbar', sandbox.getModule('documentToolbar').getView());
         },
         ready: function() {
             views.visualEditing.setView('toolbar', sandbox.getModule('documentToolbar').getView());
         },
-        toggleGrid: function(toggle) {
-            sandbox.getModule('documentCanvas').toggleGrid(toggle);
-        },
-        newNodeRequested: function(wlxmlTag, wlxmlClass) {
-                sandbox.getModule('documentCanvas').insertNewNode(wlxmlTag, wlxmlClass);
-        },
-        command: function(cmd, meta) {
-            sandbox.getModule('documentCanvas').command(cmd, meta);
+        command: function(cmd, params) {
+            sandbox.getModule('documentCanvas').command(cmd, params);
         }
     };
     
         }
     };