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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Feb 12 09:39:09 UTC 2019


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

New commits:
commit 6b90da49d34be72fa3b315232cd0fd3b6ca3f560
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Feb 12 11:31:36 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Feb 12 11:38:12 2019 +0200

    Unbreak running in Responsive Design Mode in Safari on macOS
    
    When "emulating" an iPad in Responsive Design Mode on macOS,
    L.Browser.touch is false so the code at the end of Map.Tap.js that
    calls L.Map.addInitHook() to add the 'tap' thing is not executed. But
    L.Browser.mobile is true, so the code in Map.js that tried to access
    this.tap was still executed and caused a 'TypeError: undefined is not
    an object'.
    
    Possibly this also helps in similar modes in other browsers.
    
    Change-Id: I5dbc1e6b9f80a8f691d400516d95ee950060ae18

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 92d36160c..0883f1afd 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -112,7 +112,9 @@ L.Map = L.Evented.extend({
 
 		if (L.Browser.mobile) {
 			this._clipboardContainer = L.control.mobileInput().addTo(this);
-			this._clipboardContainer._cursorHandler.on('up', this.tap._onCursorClick, this.tap);
+			if (this.tap !== undefined) {
+				this._clipboardContainer._cursorHandler.on('up', this.tap._onCursorClick, this.tap);
+			}
 		} else {
 			this._clipboardContainer = L.clipboardContainer();
 			this.addLayer(this._clipboardContainer);


More information about the Libreoffice-commits mailing list