Commit 1f0581bb authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_document_scanner: Add spinner in button to show that we are saving it in background

parent 4307cf00
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
function buildPreviousThumbnailDom(gadget) { function buildPreviousThumbnailDom(gadget) {
var i, var i,
img_class, img_class,
btn_class = "",
len = gadget.state.page_count, len = gadget.state.page_count,
thumbnail_dom_list = []; thumbnail_dom_list = [];
...@@ -198,8 +199,13 @@ ...@@ -198,8 +199,13 @@
} else { } else {
img_class = "show-img"; img_class = "show-img";
} }
if (gadget.state['blob_state_' + i] === "saving") {
btn_class = "ui-btn-icon-left ui-icon-spinner";
}
thumbnail_dom_list.push(domsugar('button', { thumbnail_dom_list.push(domsugar('button', {
type: "button", type: "button",
"class": btn_class,
// Do not allow to show again the current image // Do not allow to show again the current image
// or do not allow to show saving image (to simplify button management) // or do not allow to show saving image (to simplify button management)
disabled: (i === gadget.state.page) || (gadget.state['blob_state_' + i] === 'saving') disabled: (i === gadget.state.page) || (gadget.state['blob_state_' + i] === 'saving')
...@@ -477,7 +483,6 @@ ...@@ -477,7 +483,6 @@
// Only refresh the thumbnail list // Only refresh the thumbnail list
// if display_step is not modified // if display_step is not modified
// XXX TODO use a more precise selector
return buildPreviousThumbnailDom(gadget) return buildPreviousThumbnailDom(gadget)
.push(function (result) { .push(function (result) {
thumbnail_container = gadget.element.querySelector('.thumbnail-list'); thumbnail_container = gadget.element.querySelector('.thumbnail-list');
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.42519.52255.48861</string> </value> <value> <string>981.43882.8130.35481</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1580941317.11</float> <float>1581025205.74</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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