summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-05-21 18:44:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-12 00:01:49 +0100
commit0573e2d31c9c608aa984c8f5378e8f0097f4c774 (patch)
tree8693636d548b8053d390a643c967159500c59aef /bitbake/lib/toaster/toastergui/static/js/libtoaster.js
parenteb28534423092624c6a82cbf8ffcff23a41b7ec0 (diff)
downloadpoky-0573e2d31c9c608aa984c8f5378e8f0097f4c774.tar.gz
bitbake: toaster: Add ajax loading spinner
This adds an ajax loading spinner to provide feedback when in-page loading is happening. It will show after 1.2 seconds of initial loading. [YOCTO #7790] (Bitbake rev: ecb70b0bc996529f1a6e58e5716b31e273395c98) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/libtoaster.js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index 23755a75f2..c3798336f2 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -341,6 +341,8 @@ function reload_params(params) {
341/* Things that happen for all pages */ 341/* Things that happen for all pages */
342$(document).ready(function() { 342$(document).ready(function() {
343 343
344 var ajaxLoadingTimer;
345
344 /* If we don't have a console object which might be the case in some 346 /* If we don't have a console object which might be the case in some
345 * browsers, no-op it to avoid undefined errors. 347 * browsers, no-op it to avoid undefined errors.
346 */ 348 */
@@ -482,6 +484,26 @@ $(document).ready(function() {
482 $('#collapse-warnings').addClass('in'); 484 $('#collapse-warnings').addClass('in');
483 } 485 }
484 486
487 /* Show the loading notification if nothing has happend after 1.5
488 * seconds
489 */
490 $(document).bind("ajaxStart", function(){
491 if (ajaxLoadingTimer)
492 window.clearTimeout(ajaxLoadingTimer);
493
494 ajaxLoadingTimer = window.setTimeout(function() {
495 $("#loading-notification").fadeIn();
496 }, 1200);
497 });
498
499 $(document).bind("ajaxStop", function(){
500 if (ajaxLoadingTimer)
501 window.clearTimeout(ajaxLoadingTimer);
502
503 $("#loading-notification").fadeOut();
504 });
505
506
485 function check_for_duplicate_ids () { 507 function check_for_duplicate_ids () {
486 /* warn about duplicate element ids */ 508 /* warn about duplicate element ids */
487 var ids = {}; 509 var ids = {};