});
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) {
});
dialog.show();
},
+ dropDraft: function() {
+ logger.debug('Dropping a draft...');
+ wlxmlDocument.loadXML(sandbox.getBootstrappedData().document);
+ draftDirty = false;
+ logger.debug('Draft dropped');
+ },
getDocumentId: function() {
return document_id;
},