editor: Fix jumping to a different version of a document
[fnpeditor.git] / src / editor / modules / rng / rng.js
index e4731cc..e4f5c3e 100644 (file)
@@ -203,7 +203,12 @@ return function(sandbox) {
         },
         displayVersion: function(event) {
             /* globals window */
         },
         displayVersion: function(event) {
             /* globals window */
-            window.open('/' + gettext('editor') + '/' + sandbox.getModule('data').getDocumentId() + '?version=' + event.version, _.uniqueId());
+            var config = sandbox.getConfig();
+            if(config.documentUrl) {
+                window.open(config.documentUrl(sandbox.getModule('data').getDocumentId(), event.version), _.uniqueId());
+            } else {
+                logger.error('Unable to show version ' + event.version + ' of a document - config.documentUrl missing');
+            }
         }
     };
     
         }
     };