aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/loader
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/directives/loader')
-rw-r--r--catalog-ui/src/app/directives/loader/loader-directive.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/catalog-ui/src/app/directives/loader/loader-directive.ts b/catalog-ui/src/app/directives/loader/loader-directive.ts
index 7e056c774f..cb17c0b1b9 100644
--- a/catalog-ui/src/app/directives/loader/loader-directive.ts
+++ b/catalog-ui/src/app/directives/loader/loader-directive.ts
@@ -126,11 +126,13 @@ export class LoaderDirective implements ng.IDirective {
scope.$watch("display", (newVal, oldVal) => {
element.css('display', 'none');
+ let timeout;
if (newVal === true) {
- window.setTimeout(():void => {
+ timeout = window.setTimeout(():void => {
element.css('display', 'block');
}, 500);
} else {
+ window.clearTimeout(timeout);
window.setTimeout(():void => {
element.css('display', 'none');
}, 0);