editor: minor refactoring
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 7 Aug 2014 09:28:34 +0000 (11:28 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 7 Aug 2014 10:19:14 +0000 (12:19 +0200)
src/editor/modules/data/data.js
src/editor/modules/rng/rng.js

index b3b9fe4..4cd7dd1 100644 (file)
@@ -284,9 +284,6 @@ return function(sandbox) {
             draftDirty = false;
             logger.debug('Draft dropped');
             sandbox.publish('draftDropped');
             draftDirty = false;
             logger.debug('Draft dropped');
             sandbox.publish('draftDropped');
-        },
-        getDocumentId: function() {
-            return document_id;
         }
     };
 };
         }
     };
 };
index e4f5c3e..d49b6bf 100644 (file)
@@ -203,9 +203,11 @@ return function(sandbox) {
         },
         displayVersion: function(event) {
             /* globals window */
         },
         displayVersion: function(event) {
             /* globals window */
-            var config = sandbox.getConfig();
+            var config = sandbox.getConfig(),
+                doc = sandbox.getModule('data').getDocument();
+
             if(config.documentUrl) {
             if(config.documentUrl) {
-                window.open(config.documentUrl(sandbox.getModule('data').getDocumentId(), event.version), _.uniqueId());
+                window.open(config.documentUrl(doc.properties.document_id, event.version), _.uniqueId());
             } else {
                 logger.error('Unable to show version ' + event.version + ' of a document - config.documentUrl missing');
             }
             } else {
                 logger.error('Unable to show version ' + event.version + ' of a document - config.documentUrl missing');
             }