Visual editor: selecting first node on first display
[fnpeditor.git] / modules / rng.js
index 4e0ca6e..6ea6f40 100644 (file)
@@ -41,6 +41,10 @@ rng.modules.rng = function(sandbox) {
                     editor.setDirty(false);\r
                 }\r
             }\r
+        },\r
+        showed: function(slug) {\r
+            if(slug === 'visual')\r
+                sandbox.getModule('visualEditor').onShowed();\r
         }\r
     };\r
     \r
@@ -53,8 +57,9 @@ rng.modules.rng = function(sandbox) {
     \r
     eventHandlers.visualEditor = {\r
         ready: function() {\r
-            addTab('Visual', 'visual', sandbox.getModule('visualEditor').getView());\r
             sandbox.getModule('visualEditor').setDocument(sandbox.getModule('data').getDocument());\r
+            addTab('Visual', 'visual', sandbox.getModule('visualEditor').getView());\r
+            \r
         }\r
     };\r
     \r