diff options
author | Henry Castro <hcastro@collabora.com> | 2022-05-10 16:25:50 -0400 |
---|---|---|
committer | Gökay ŞATIR <gokaysatir@gmail.com> | 2022-05-24 11:59:38 +0300 |
commit | 4c8533663f709ef1ffb47e34599da3995f467290 (patch) | |
tree | a0ab8101f32e2212efd532f5ae960f9da62f1470 /browser | |
parent | wsd: infobar: clean up unused code (diff) | |
download | online-4c8533663f709ef1ffb47e34599da3995f467290.tar.gz online-4c8533663f709ef1ffb47e34599da3995f467290.zip |
infobar: enable info bar handler to check ...
the latest version available
Change-Id: Iff89895757fdd2ae83eb34401480253967234bbe
Signed-off-by: Henry Castro <hcastro@collabora.com>
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Diffstat (limited to 'browser')
-rw-r--r-- | browser/src/map/handler/Map.Infobar.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/browser/src/map/handler/Map.Infobar.js b/browser/src/map/handler/Map.Infobar.js index 70c8c3b391..749da4e563 100644 --- a/browser/src/map/handler/Map.Infobar.js +++ b/browser/src/map/handler/Map.Infobar.js @@ -4,18 +4,22 @@ */ /* global app _ */ +L.Map.mergeOptions({ + infobar: true +}); + L.Map.Infobar = L.Handler.extend({ addHooks: function () { - this._map.on('updateviewslist', this.onUpdateList, this); + this._intervalInfo = setInterval(L.bind(this.onUpdateInfo, this), 1800000); this._map.on('infobar', this.onInfobar, this); }, removeHooks: function () { - this._map.off('updateviewslist', this.onUpdateList, this); + clearInterval(this._intervalInfo); this._map.off('infobar', this.onInfobar, this); }, - onUpdateList: function () { + onUpdateInfo: function () { var docLayer = this._map._docLayer || {}; var viewInfo = this._map._viewInfo[docLayer._viewId]; @@ -53,6 +57,7 @@ L.Map.Infobar = L.Handler.extend({ window.localStorage.setItem('InfoBarLaterDate', currentDate.getTime()); snackbarMessage = snackbarMessage.replace('%0', latestVersion); this._map.uiManager.showSnackbar(snackbarMessage); + clearInterval(this._intervalInfo); break; } if (v1 < v2) { |