From 9da575320a658b0f543c8ff4ac0ebe43fdd975e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Fri, 22 Nov 2013 11:54:53 +0100 Subject: [PATCH] integration wip: restoring document --- src/editor/modules/data/data.js | 1 + src/editor/modules/rng/rng.js | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/editor/modules/data/data.js b/src/editor/modules/data/data.js index 7f60004..7c9077f 100644 --- a/src/editor/modules/data/data.js +++ b/src/editor/modules/data/data.js @@ -108,6 +108,7 @@ return function(sandbox) { success: function(data) { document_version = data.current_version; reloadHistory(); + wlxmlDocument.loadXML(data.document); sandbox.publish('documentReverted', data); }, }); diff --git a/src/editor/modules/rng/rng.js b/src/editor/modules/rng/rng.js index b1e091c..b6b103f 100644 --- a/src/editor/modules/rng/rng.js +++ b/src/editor/modules/rng/rng.js @@ -45,15 +45,6 @@ return function(sandbox) { }, updateCurrentTextElement: function(textElement) { sandbox.getModule('nodeFamilyTree').setElement(textElement); - }, - resetDocument: function(document, reason) { - var modules = []; - if (reason === 'revert') { - modules = ['documentCanvas', 'metadataEditor', 'sourceEditor']; - } - modules.forEach(function(moduleName) { - sandbox.getModule(moduleName).setDocument(document); - }); } }; @@ -116,7 +107,6 @@ return function(sandbox) { sandbox.getModule('diffViewer').setDiff(diff); }, documentReverted: function(event) { - commands.resetDocument(event.document, 'revert'); sandbox.getModule('mainBar').setCommandEnabled('save', true); sandbox.getModule('indicator').clearMessage({message:'Wersja ' + event.reverted_version + ' przywrócona'}); sandbox.getModule('mainBar').setVersion(event.current_version); -- 2.20.1