From: Aleksander Ɓukasz Date: Wed, 5 Mar 2014 13:08:55 +0000 (+0100) Subject: editor: fix - save local draft after source editor commits changes X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/3bd06959f2210e5d03b9377400b3b02b18a2e1ae editor: fix - save local draft after source editor commits changes --- diff --git a/src/editor/modules/data/data.js b/src/editor/modules/data/data.js index 84f0af8..7488390 100644 --- a/src/editor/modules/data/data.js +++ b/src/editor/modules/data/data.js @@ -41,11 +41,14 @@ return function(sandbox) { }); var modificationFlag = true; - wlxmlDocument.on('change', function() { + var handleChange = function() { documentDirty = true; draftDirty = true; modificationFlag = true; - }); + }; + wlxmlDocument.on('change', handleChange); + wlxmlDocument.on('contentSet', handleChange); + if(window.localStorage) { window.setInterval(function() { if(modificationFlag) {