Commit f319e070 authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: import/export: disable button on import and redirect on finish

parent acc3e142
......@@ -128,10 +128,13 @@
}
function importAllDocs(gadget) {
var files = gadget.props.files_preloaded_for_import;
var files = gadget.props.files_preloaded_for_import,
element = gadget.props.element;
if (gadget.props.files_preloaded_for_import.lenght === 0) {
return;
}
element.querySelector("form.import-form button").disabled = true;
element.querySelector("form.import-form input").disabled = true;
return new RSVP.Queue()
.push(function () {
return gadget.getGlobalSetting('document_version');
......@@ -177,6 +180,9 @@
return gadget.jio_put(file.id, obj);
});
}));
})
.push(function (result) {
return gadget.redirect({});
});
}
......@@ -202,6 +208,7 @@
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_put", "jio_put")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("redirect", "redirect")
.declareMethod("allDocsArchived", function (opt) {
var gadget = this,
file_storage = jIO.createJIO(opt);
......
......@@ -95,7 +95,7 @@
</item>
<item>
<key> <string>revision</string> </key>
<value> <string>23</string> </value>
<value> <string>2</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.63546.2887.36539</string> </value>
<value> <string>957.565.52763.13875</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1485715004.23</float>
<float>1485883064.26</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