[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-1' - loleaflet/src

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 26 16:57:59 UTC 2020


 loleaflet/src/map/Map.js |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 38b97e1791eb472cd320e3b2f1560a87c43c9e0f
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Mar 24 16:44:11 2020 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Mar 26 17:57:39 2020 +0100

    leaflet: reuse member functions
    
    Change-Id: I8c0c58d2ab175b271df200de2b100e61c655db5f
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91018
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91130

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index f8522d1b8..024192295 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -874,7 +874,8 @@ L.Map = L.Evented.extend({
 		return this._winId;
 	},
 
-	// Returns true iff the document has input focus.
+	// Returns true iff the document has input focus,
+	// as opposed to a dialog, sidebar, formula bar, etc.
 	editorHasFocus: function () {
 		return this.getWinId() === 0;
 	},
@@ -1403,7 +1404,7 @@ L.Map = L.Evented.extend({
 	_changeFocusWidget: function (dialog, winId, acceptInput) {
 		if (!this._loaded) { return; }
 
-		this._winId = winId;
+		this.setWinId(winId);
 		this._activeDialog = dialog;
 		this._isSearching = false;
 
@@ -1431,11 +1432,11 @@ L.Map = L.Evented.extend({
 
 	// Our browser tab got focus.
 	_onGotFocus: function () {
-		if (this._winId === 0) {
+		if (this.editorHasFocus()) {
 			this.fire('editorgotfocus');
 		}
 		else if (this._activeDialog) {
-			this._activeDialog.focus(this._winId);
+			this._activeDialog.focus(this.getWinId());
 		}
 
 		this._activate();


More information about the Libreoffice-commits mailing list