Commit e2feb88b authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Add a loading notification on the listbox

parent 9a8f9d7d
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<script id="listbox-template" type="text/x-handlebars-template"> <script id="listbox-template" type="text/x-handlebars-template">
<div class="ui-table-header ui-header ui-bar-c ui-corner-all"> <div class="ui-table-header ui-header ui-bar-c ui-corner-all">
<h1 data-i18n="{{title}}" class="ui-title ui-override-theme">{{title}}</h1> <h1 data-i18n="{{title}}" class="ui-title ui-override-theme">{{title}}<span> <span class="listboxloader ui-icon-spinner ui-btn-icon-left"></span></span></h1>
<!--div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left"> <!--div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls"--> <div class="ui-controlgroup-controls"-->
<button data-rel="hide" data-i18n="Hide Rows" name="Hide" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-eye ui-btn-icon-left {{hide_class}}">Hide Rows</button> <button data-rel="hide" data-i18n="Hide Rows" name="Hide" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-eye ui-btn-icon-left {{hide_class}}">Hide Rows</button>
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>953.48474.52969.47820</string> </value> <value> <string>957.57984.47063.18944</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1474554275.61</float> <float>1489052266.08</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -318,6 +318,8 @@ ...@@ -318,6 +318,8 @@
dataset, dataset,
counter, counter,
limit_options, limit_options,
loading_element_classList = gadget.element.querySelector(".listboxloader").classList,
loading_class_list = ['ui-icon-spinner', 'ui-btn-icon-left'],
i; i;
if (only_cancel) { if (only_cancel) {
...@@ -353,6 +355,7 @@ ...@@ -353,6 +355,7 @@
} else { } else {
limit_options = [begin_from, lines + 1]; limit_options = [begin_from, lines + 1];
} }
loading_element_classList.add.apply(loading_element_classList, loading_class_list);
return gadget.jio_allDocs({ return gadget.jio_allDocs({
// XXX Not jIO compatible, but until a better api is found... // XXX Not jIO compatible, but until a better api is found...
...@@ -471,6 +474,7 @@ ...@@ -471,6 +474,7 @@
return renderListboxTfoot(gadget); return renderListboxTfoot(gadget);
}) })
.push(function (my_html) { .push(function (my_html) {
loading_element_classList.remove.apply(loading_element_classList, loading_class_list);
gadget.element.querySelector(".tfoot").innerHTML = my_html; gadget.element.querySelector(".tfoot").innerHTML = my_html;
}); });
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.15532.4001.22118</string> </value> <value> <string>957.57991.29866.61081</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1482835694.43</float> <float>1489052755.84</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