diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/libtoaster.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index a61b10e972..f56affd8ea 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js | |||
@@ -436,8 +436,23 @@ var libtoaster = (function () { | |||
436 | }); | 436 | }); |
437 | } | 437 | } |
438 | 438 | ||
439 | // if true, the loading spinner for Ajax requests will be displayed | ||
440 | // if requests take more than 1200ms | ||
441 | var ajaxLoadingTimerEnabled = true; | ||
442 | |||
443 | // turn on the page-level loading spinner for Ajax requests | ||
444 | function _enableAjaxLoadingTimer() { | ||
445 | ajaxLoadingTimerEnabled = true; | ||
446 | } | ||
447 | |||
448 | // turn off the page-level loading spinner for Ajax requests | ||
449 | function _disableAjaxLoadingTimer() { | ||
450 | ajaxLoadingTimerEnabled = false; | ||
451 | } | ||
439 | 452 | ||
440 | return { | 453 | return { |
454 | enableAjaxLoadingTimer: _enableAjaxLoadingTimer, | ||
455 | disableAjaxLoadingTimer: _disableAjaxLoadingTimer, | ||
441 | reload_params : reload_params, | 456 | reload_params : reload_params, |
442 | startABuild : _startABuild, | 457 | startABuild : _startABuild, |
443 | cancelABuild : _cancelABuild, | 458 | cancelABuild : _cancelABuild, |
@@ -485,7 +500,6 @@ function reload_params(params) { | |||
485 | window.location.href = url+"?"+callparams.join('&'); | 500 | window.location.href = url+"?"+callparams.join('&'); |
486 | } | 501 | } |
487 | 502 | ||
488 | |||
489 | /* Things that happen for all pages */ | 503 | /* Things that happen for all pages */ |
490 | $(document).ready(function() { | 504 | $(document).ready(function() { |
491 | 505 | ||
@@ -644,7 +658,9 @@ $(document).ready(function() { | |||
644 | window.clearTimeout(ajaxLoadingTimer); | 658 | window.clearTimeout(ajaxLoadingTimer); |
645 | 659 | ||
646 | ajaxLoadingTimer = window.setTimeout(function() { | 660 | ajaxLoadingTimer = window.setTimeout(function() { |
647 | $("#loading-notification").fadeIn(); | 661 | if (libtoaster.ajaxLoadingTimerEnabled) { |
662 | $("#loading-notification").fadeIn(); | ||
663 | } | ||
648 | }, 1200); | 664 | }, 1200); |
649 | }); | 665 | }); |
650 | 666 | ||