[Libreoffice-commits] online.git: loleaflet/src

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 7 06:27:45 UTC 2019


 loleaflet/src/map/Map.js |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 253e3245d1e953f79a38969ea84b10cdbbad8626
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Nov 6 18:00:52 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Nov 7 07:27:25 2019 +0100

    Make the sidebar show up again in the iOS app on iPad
    
    Reduce confusion between whether to use "jsdialog" (also known as
    "mobile wizard") or the sidebar.
    
    Make core's comphelper::LibreOfficeKit::isMobile() equivalent to
    window.mode.isMobile(). Decide whether to send the .uno:LOKSetMobile
    message using the same condition that the function _inMobileMode()
    uses, i.e. (L.Browser.mobile && screen.width < 768).
    
    (window.mode.isMobile() is the same as _inMobileMode().)
    
    Previously, on iPad, comphelper::LibreOfficeKit::isMobile() returned
    true so the code in SidebarNotifyIdle::Invoke() in
    sfx2/source/sidebar/SidebarDockingWindow.cxx did the jsdialog thing,
    but the loleaflet code still did not handle the jsdialog message in
    _onJSDialogMsg() in loleaflet/src/layer/tile/TileLayer.js.
    
    Change-Id: Id7633ad3dd2dc79f1d845e07b0bf89f07ddd2625
    Reviewed-on: https://gerrit.libreoffice.org/82157
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 1c1213aa3..f336d1c7f 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -213,7 +213,11 @@ L.Map = L.Evented.extend({
 				elem.parentNode.removeChild(elem);
 			}
 
-			if (L.Browser.mobile)
+			// We need core's knowledge of whether it is a mobile phone or not (which is
+			// what .uno:LOKSetMobile does) to be in sync with the test in
+			// _onJSDialogMsg in TileLayer.js but we don't have the clout to do so
+			// except for the iOS app out of fear of breaking something.
+			if (L.Browser.mobile && (!window.ThisIsTheiOSApp || screen.width < 768))
 			{
 				this._size = new L.Point(0,0);
 				this._onResize();


More information about the Libreoffice-commits mailing list