Commit 9d47a8ce authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs_ooffice] save promise resolve when no modification

parent 0c335868
......@@ -885,9 +885,13 @@ define([
Common.Gateway.on('processmouse', _.bind(me.onProcessMouse, me));
Common.Gateway.on('refreshhistory', _.bind(me.onRefreshHistory, me));
Common.Gateway.on('save', function () {
var g = Common.Gateway;
if (me.api.isDocumentModified()) {
me.api.asc_Save();
}
if (g.props.save_defer) {
g.props.save_defer.resolve(undefined);
}
});
Common.Gateway.on('downloadas', _.bind(me.onDownloadAs, me));
......
......@@ -220,7 +220,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.37205.45053.30037</string> </value>
<value> <string>961.31926.50683.29252</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -238,7 +238,7 @@
</tuple>
<state>
<tuple>
<float>1486024275.69</float>
<float>1503045227.0</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -668,9 +668,13 @@ define([
Common.Gateway.on('processrightschange', _.bind(me.onProcessRightsChange, me));
Common.Gateway.on('processmouse', _.bind(me.onProcessMouse, me));
Common.Gateway.on('save', function () {
var g = Common.Gateway;
if (me.api.isDocumentModified()) {
me.api.asc_Save();
}
if (g.props.save_defer) {
g.props.save_defer.resolve(undefined);
}
});
Common.Gateway.on('downloadas', _.bind(me.onDownloadAs, me));
......
......@@ -220,7 +220,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.37205.45053.30037</string> </value>
<value> <string>961.31925.26684.9898</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -238,7 +238,7 @@
</tuple>
<state>
<tuple>
<float>1486024308.4</float>
<float>1503045344.71</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -676,9 +676,13 @@ define([
Common.Gateway.on('processrightschange', _.bind(me.onProcessRightsChange, me));
Common.Gateway.on('processmouse', _.bind(me.onProcessMouse, me));
Common.Gateway.on('save', function () {
var g = Common.Gateway;
if (me.api.asc_isDocumentModified()) {
me.api.asc_Save();
}
if (g.props.save_defer) {
g.props.save_defer.resolve(undefined);
}
});
Common.Gateway.on('downloadas', _.bind(me.onDownloadAs, me));
Common.Gateway.sendInfo({mode:me.appOptions.isEdit?'edit':'view'});
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>958.18339.3430.47257</string> </value>
<value> <string>961.31905.4301.26982</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1490605671.4</float>
<float>1503044440.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -548,8 +548,10 @@ if (Common === undefined) {
return save_defer.promise;
})
.push(function (data) {
var body = data[g.props.key];
return zip.putAttachment('/', 'body.txt', body);
if (data) {
var body = data[g.props.key];
return zip.putAttachment('/', 'body.txt', body);
}
})
.push(function () {
return zip.getAttachment('/', '/');
......
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.660.18881.18705</string> </value>
<value> <string>961.10686.10882.5973</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -251,7 +251,7 @@
</tuple>
<state>
<tuple>
<float>1501231192.91</float>
<float>1503043242.86</float>
<string>UTC</string>
</tuple>
</state>
......
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