linting, cleanup, removing unused code
[fnpeditor.git] / src / editor / modules / rng / rng.js
index 3621050..bc4ea7f 100644 (file)
@@ -45,22 +45,6 @@ return function(sandbox) {
         },
         updateCurrentTextElement: function(textElement) {
             sandbox.getModule('nodeFamilyTree').setElement(textElement);
-        },
-        resetDocument: function(document, reason) {
-            var modules = [];
-            if(reason === 'source_edit') {
-                modules = ['documentCanvas', 'metadataEditor'];
-            }
-            else if (reason === 'edit') {
-                modules = ['sourceEditor'];
-            }
-            else if (reason === 'revert') {
-                modules = ['documentCanvas', 'metadataEditor', 'sourceEditor'];
-            }
-                
-            modules.forEach(function(moduleName) {
-                sandbox.getModule(moduleName).setDocument(document);
-            });
         }
     };
     
@@ -103,9 +87,6 @@ return function(sandbox) {
                 sandbox.getModule(moduleName).start();
             });
         },
-        documentChanged: function(document, reason) {
-            commands.resetDocument(document, reason);
-        },
         savingStarted: function() {
             sandbox.getModule('mainBar').setCommandEnabled('save', false);
             sandbox.getModule('indicator').showMessage(gettext('Saving...'));
@@ -126,7 +107,6 @@ return function(sandbox) {
             sandbox.getModule('diffViewer').setDiff(diff);
         },
         documentReverted: function(event) {
-            commands.resetDocument(event.document, 'revert');
             sandbox.getModule('mainBar').setCommandEnabled('save', true);
             sandbox.getModule('indicator').clearMessage({message:'Wersja ' + event.reverted_version + ' przywrócona'});
             sandbox.getModule('mainBar').setVersion(event.current_version);
@@ -246,6 +226,7 @@ return function(sandbox) {
             sandbox.getModule('data').restoreVersion(event);
         },
         displayVersion: function(event) {
+            /* globals window */
             window.open('/' + gettext('editor') + '/' + sandbox.getModule('data').getDocumentId() + '?version=' + event.version, _.uniqueId());
         }
     };