Show load indicator after 500 ms

fixes #5540
This commit is contained in:
Alexander Klimov 2014-02-03 11:10:36 +01:00
parent 3aee13cd9b
commit 2ecf1a99a6
1 changed files with 9 additions and 1 deletions

View File

@ -192,7 +192,14 @@ define(['jquery', 'logging', 'icinga/componentLoader', 'URIjs/URI', 'URIjs/URITe
this.hideDetail();
}
cancelPendingRequest();
this.containerDom.trigger('showLoadIndicator');
var loadingTimeout = window.setTimeout(
(function(containerDom) {
return function() {
containerDom.trigger('showLoadIndicator');
}
})(this.containerDom),
500
);
pendingDetailRequest = $.ajax({
'url': url,
'data': {
@ -226,6 +233,7 @@ define(['jquery', 'logging', 'icinga/componentLoader', 'URIjs/URI', 'URIjs/URITe
this.replaceDom(response.responseText);
})
.always(function () {
window.clearTimeout(loadingTimeout);
this.containerDom.trigger('hideLoadIndicator');
});
};