Visual editor - handling double enter
[fnpeditor.git] / modules / rng.js
index 4e0ca6e..0a39ed8 100644 (file)
@@ -41,20 +41,25 @@ 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
     eventHandlers.sourceEditor = {\r
         ready: function() {\r
-            addTab('Source', 'source',  sandbox.getModule('sourceEditor').getView());\r
+            addTab(gettext('Source'), 'source',  sandbox.getModule('sourceEditor').getView());\r
             sandbox.getModule('sourceEditor').setDocument(sandbox.getModule('data').getDocument());\r
         }\r
     };\r
     \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(gettext('Visual'), 'visual', sandbox.getModule('visualEditor').getView());\r
+            \r
         }\r
     };\r
     \r