Commit 633ce5c1 authored by Boris Kocherov's avatar Boris Kocherov

[erp5_only_office] fix double save on press savebtn, and remove infinte savelock

parent 4d392b27
......@@ -500,7 +500,7 @@ DocsAPI.DocEditor.version = function () {
g.props.save_defer.resolve();
g.props.save_defer = null;
} else {
g.triggerSubmit();
return g.triggerSubmit();
}
});
})
......
......@@ -1367,6 +1367,7 @@ var editor;
this.CoAuthoringApi.saveChanges(arrChanges, deleteIndex, excelAdditionalInfo, this.canUnlockDocument2);
History.CanNotAddChanges = true;
} else {
this.CoAuthoringApi.onUnSaveLock();
this.CoAuthoringApi.unLockDocument(true, this.canUnlockDocument2);
}
this.canUnlockDocument2 = false;
......
......@@ -716,7 +716,7 @@ define([
Common.Gateway.on('processrightschange', _.bind(me.onProcessRightsChange, me));
Common.Gateway.on('processmouse', _.bind(me.onProcessMouse, me));
Common.Gateway.on('save', function () {
if (me.api.asc_isDocumentModified()) {
if (me.api.asc_isDocumentModified() && me.api.asc_isDocumentCanSave()) {
me.api.asc_Save();
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment