Skip to contentSkip to conversation

toaster: tablejs Add visual indicate to data loading

PATCH New Michael Wood 1 participant 1 message Nov 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toaster: tablejs Add visual indicate to data loading

Add a visual indicator when the data is changing in the table, for instance if it's being re-ordered, searched or paginated.

[YOCTO #10104]

---
 bitbake/lib/toaster/toastergui/static/js/table.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
bitbake/lib/toaster/toastergui/static/js/table.js +10 -0
index 176ce57..1bbc8d1 100644
@@ -39,6 +39,8 @@ function tableInit(ctx){
                               ', .show-all-'+ctx.tableName);
 
   function loadData(tableParams){
+    table.trigger("table-loading");
+
     $.ajax({
         type: "GET",
         url: ctx.url,
@@ -835,4 +837,12 @@ function tableInit(ctx){
 
     $('#filter-modal-'+ctx.tableName).modal('hide');
   });
+
+  table.on("table-loading", function(){
+    table.css("opacity", 0.5);
+  });
+
+  table.on("table-done", function(){
+    table.css("opacity", 1);
+  })
 }
Signature · 1 line
2.7.4