diff --git a/web/ui_utils.js b/web/ui_utils.js index 6ed4c2dcb..b4f2d7365 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -275,6 +275,7 @@ var ProgressBar = (function ProgressBarClosure() { } function ProgressBar(id, opts) { + this.visible = true; // Fetch the sub-elements for later. this.div = document.querySelector(id + ' .progress'); @@ -328,8 +329,21 @@ var ProgressBar = (function ProgressBarClosure() { }, hide: function ProgressBar_hide() { + if (!this.visible) { + return; + } + this.visible = false; this.bar.classList.add('hidden'); - this.bar.removeAttribute('style'); + document.body.classList.remove('loadingInProgress'); + }, + + show: function ProgressBar_show() { + if (this.visible) { + return; + } + this.visible = true; + document.body.classList.add('loadingInProgress'); + this.bar.classList.remove('hidden'); } }; diff --git a/web/viewer.html b/web/viewer.html index 31f40a98b..f562dbd66 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -96,8 +96,8 @@ http://sourceforge.net/adobe/cmap/wiki/License/ -
-