X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/da569ef28d8d794efcd2de7754629c85c0de9104..a6983a6a33c76bc7ae107c604ba73c3571aed7b8:/src/editor/modules/rng/rng.js diff --git a/src/editor/modules/rng/rng.js b/src/editor/modules/rng/rng.js index e4731cc..d49b6bf 100644 --- a/src/editor/modules/rng/rng.js +++ b/src/editor/modules/rng/rng.js @@ -203,7 +203,14 @@ return function(sandbox) { }, displayVersion: function(event) { /* globals window */ - window.open('/' + gettext('editor') + '/' + sandbox.getModule('data').getDocumentId() + '?version=' + event.version, _.uniqueId()); + var config = sandbox.getConfig(), + doc = sandbox.getModule('data').getDocument(); + + if(config.documentUrl) { + 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'); + } } };