From a6983a6a33c76bc7ae107c604ba73c3571aed7b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 7 Aug 2014 11:28:34 +0200 Subject: [PATCH 1/1] editor: minor refactoring --- src/editor/modules/data/data.js | 3 --- src/editor/modules/rng/rng.js | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/editor/modules/data/data.js b/src/editor/modules/data/data.js index b3b9fe4..4cd7dd1 100644 --- a/src/editor/modules/data/data.js +++ b/src/editor/modules/data/data.js @@ -284,9 +284,6 @@ return function(sandbox) { draftDirty = false; logger.debug('Draft dropped'); sandbox.publish('draftDropped'); - }, - getDocumentId: function() { - return document_id; } }; }; diff --git a/src/editor/modules/rng/rng.js b/src/editor/modules/rng/rng.js index e4f5c3e..d49b6bf 100644 --- a/src/editor/modules/rng/rng.js +++ b/src/editor/modules/rng/rng.js @@ -203,9 +203,11 @@ return function(sandbox) { }, displayVersion: function(event) { /* globals window */ - var config = sandbox.getConfig(); + var config = sandbox.getConfig(), + doc = sandbox.getModule('data').getDocument(); + 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'); } -- 2.20.1