Fixing dirty state management in source editor
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Oct 2013 07:52:15 +0000 (09:52 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 2 Dec 2013 13:50:52 +0000 (14:50 +0100)
Without setting this flag here, ace editor change event triggered
on initial document load was followed by setting xml on document
again in onHide event handler.

src/editor/modules/sourceEditor/sourceEditor.js

index 8159680..0d7b12e 100644 (file)
@@ -13,6 +13,8 @@ return function(sandbox) {
         if(documentIsDirty) {
             editor.setValue(wlxmlDocument.toXML());
             editor.gotoLine(0);
+            documentEditedHere = false;
+
             sandbox.publish('documentSet');
             documentIsDirty = false;
         }