From: Aleksander Ɓukasz Date: Thu, 7 Aug 2014 09:25:30 +0000 (+0200) Subject: editor: Fix jumping to a different version of a document X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/a6919c029590f1b93e156264b063f2a9bbcff8dc?hp=a892115bc1f94bfd53873dd442854b5ebe3fd03c editor: Fix jumping to a different version of a document --- diff --git a/src/editor/modules/rng/rng.js b/src/editor/modules/rng/rng.js index e4731cc..e4f5c3e 100644 --- a/src/editor/modules/rng/rng.js +++ b/src/editor/modules/rng/rng.js @@ -203,7 +203,12 @@ return function(sandbox) { }, 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'); + } } };