diff options
author | Andrejs Verza <andrejs.verza@zabbix.com> | 2022-01-28 15:58:08 +0300 |
---|---|---|
committer | Andrejs Verza <andrejs.verza@zabbix.com> | 2022-02-03 10:11:29 +0300 |
commit | 144edd139fd9254c7ad8e8f879f44f46ac677ea9 (patch) | |
tree | 43de0ea915e732bef6a401523ed806416238ea2f /ui | |
parent | 2d4e5a4784ed4c7dde679d5855050b2829b182f4 (diff) |
..F....... [ZBX-20494] fixed multiple hintbox issue upon widget updates
* commit '3d37c69c7eca5ec07f946b59c92ecc589cfde062':
..F....... [ZBX-20494] fixed multiple hintbox issue upon widget updates
(cherry picked from commit be11f0fc50749c1590a0eddd59511fe90d06056a)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/js/widgets/class.widget.js | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/ui/js/widgets/class.widget.js b/ui/js/widgets/class.widget.js index ac4d19d4620..87d4550eb50 100644 --- a/ui/js/widgets/class.widget.js +++ b/ui/js/widgets/class.widget.js @@ -120,8 +120,6 @@ class CWidget extends CBaseComponent { this._update_abort_controller = null; this._is_updating_paused = false; this._update_retry_sec = 3; - this._preloader_timeout = null; - this._preloader_timeout_sec = 10; this._show_preloader_asap = true; this._resizable_handles = []; } @@ -516,7 +514,7 @@ class CWidget extends CBaseComponent { if (delay_sec > 0) { this._update_timeout_id = setTimeout(() => { this._update_timeout_id = null; - this._startUpdating(0, {do_update_once: do_update_once}); + this._startUpdating(0, {do_update_once}); }, delay_sec * 1000); } else { @@ -556,7 +554,7 @@ class CWidget extends CBaseComponent { _update(do_update_once) { if (this._update_abort_controller !== null || this._is_updating_paused || this.isUserInteracting()) { - this._startUpdating(1, {do_update_once: do_update_once}); + this._startUpdating(1, {do_update_once}); return; } @@ -584,7 +582,7 @@ class CWidget extends CBaseComponent { this._hidePreloader(); } else { - this._startUpdating(this._update_retry_sec, {do_update_once: do_update_once}); + this._startUpdating(this._update_retry_sec, {do_update_once}); } }) .finally(() => { @@ -786,38 +784,16 @@ class CWidget extends CBaseComponent { } _showPreloader() { - if (this._preloader_timeout !== null) { - clearTimeout(this._preloader_timeout); - this._preloader_timeout = null; - } - this._content_body.classList.add('is-loading'); + this._content_body.classList.remove('is-loading-fadein', 'delayed-15s'); } _hidePreloader() { - if (this._preloader_timeout !== null) { - clearTimeout(this._preloader_timeout); - this._preloader_timeout = null; - } - - this._content_body.classList.remove('is-loading'); + this._content_body.classList.remove('is-loading', 'is-loading-fadein', 'delayed-15s'); } - _schedulePreloader(delay_sec = this._preloader_timeout_sec) { - if (this._preloader_timeout !== null) { - return; - } - - const is_showing_preloader = this._content_body.classList.contains('is-loading'); - - if (is_showing_preloader) { - return; - } - - this._preloader_timeout = setTimeout(() => { - this._preloader_timeout = null; - this._showPreloader(); - }, delay_sec * 1000); + _schedulePreloader() { + this._content_body.classList.add('is-loading', 'is-loading-fadein', 'delayed-15s'); } _makeView() { |