loleaflet/src/control/Control.Toolbar.js | 4 ++-- loleaflet/src/core/LOUtil.js | 6 ++++++ loleaflet/src/main.js | 2 -- loleaflet/src/map/Map.js | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-)
New commits: commit 2f6c4acf8246a1fffe99d3bb0d7ffa74e21f4ab0 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Mon Jan 6 15:33:12 2020 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Mon Jan 6 21:25:12 2020 +0100 loleaflet: move global variable 'closeButtonEnabled' There are global variables when the early websocket connection is in progress while the bundle JS file is being downloaded, so in order to not confuse it is preferable to move to another location. Change-Id: I36b3e52c87666c5a805c2286af45ec5b44d79619 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86296 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index f053d2b55..11614f543 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -2599,9 +2599,9 @@ function setupToolbar(e) { map.on('commandstatechanged', onCommandStateChanged); map.on('commandvalues', onCommandValues, this); - if (!window.closeButtonEnabled) { + if (!L.Params.closeButtonEnabled) { $('#closebuttonwrapper').hide(); - } else if (window.closeButtonEnabled && !L.Browser.mobile) { + } else if (L.Params.closeButtonEnabled && !L.Browser.mobile) { $('#closebuttonwrapper').show(); $('.closebuttonimage').show(); } diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js index 95252882d..780f83a8f 100644 --- a/loleaflet/src/core/LOUtil.js +++ b/loleaflet/src/core/LOUtil.js @@ -1,4 +1,5 @@ /* -*- js-indent-level: 8 -*- */ +/* global getParameterByName */ /* * L.LOUtil contains various LO related utility functions used throughout the code */ @@ -111,3 +112,8 @@ L.LOUtil = { return res; } }; + +L.Params = { + /// Shows close button if non-zero value provided + closeButtonEnabled: getParameterByName('closebutton'), +}; diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js index f4b7be0c9..45373715e 100644 --- a/loleaflet/src/main.js +++ b/loleaflet/src/main.js @@ -26,8 +26,6 @@ if (reuseCookies !== '') { var filePath = getParameterByName('file_path'); var permission = getParameterByName('permission') || 'edit'; var timestamp = getParameterByName('timestamp'); -// Shows close button if non-zero value provided -window.closeButtonEnabled = getParameterByName('closebutton'); // Shows revision history file menu option var revHistoryEnabled = getParameterByName('revisionhistory'); // Should the document go inactive or not diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 778013556..74795391e 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -1676,7 +1676,7 @@ L.Map = L.Evented.extend({ if (!this.isMenubarHidden()) return; $('.main-nav').show(); - if (window.closeButtonEnabled && !window.mode.isTablet()) { + if (L.Params.closeButtonEnabled && !window.mode.isTablet()) { $('#closebuttonwrapper').show(); } @@ -1694,7 +1694,7 @@ L.Map = L.Evented.extend({ if (this.isMenubarHidden()) return; $('.main-nav').hide(); - if (window.closeButtonEnabled) { + if (L.Params.closeButtonEnabled) { $('#closebuttonwrapper').hide(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits