X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/cb800d0ee02280d6e2663cf0524fb74681c8173e..5fa477181f00d867a51d9f6e4fb1915522d725f5:/modules/rng/rng.js?ds=inline diff --git a/modules/rng/rng.js b/modules/rng/rng.js index fe666e0..43216bd 100644 --- a/modules/rng/rng.js +++ b/modules/rng/rng.js @@ -30,16 +30,19 @@ return function(sandbox) { } if(tabIsDirty(slug)) { + var reason, doc; if(slug === 'sourceEditor') { - sandbox.getModule('data').commitDocument(sandbox.getModule('sourceEditor').getDocument(), 'source_edit'); + doc = sandbox.getModule('sourceEditor').getDocument(); + reason = 'source_edit'; } if(slug === 'editor') { var doc = dirty.documentCanvas ? sandbox.getModule('documentCanvas').getDocument() : sandbox.getModule('data').getDocument(); if(dirty.metadataEditor) { doc = sandbox.getModule('metadataEditor').attachMetadata(doc); } - sandbox.getModule('data').commitDocument(doc, 'edit'); + reason = 'edit'; } + sandbox.getModule('data').commitDocument(doc, reason); } } @@ -132,7 +135,7 @@ return function(sandbox) { sandbox.getModule('indicator').clearMessage(); }, historyItemAdded: function(item) { - sandbox.getModule('documentHistory').addHistory([item]); + sandbox.getModule('documentHistory').addHistory([item], {animate: true}); } }