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

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 25 11:29:10 UTC 2020


 loleaflet/src/control/Control.LokDialog.js |    3 +--
 loleaflet/src/map/Map.js                   |    9 +++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 41cd5a562470c47564e1f6b0a7fc43458bdbae1c
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: Wed Mar 25 12:29:05 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>

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();
commit 9ccea6c8b869c427ea393e4057fd530758c17b31
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Mar 24 17:14:31 2020 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Mar 25 12:28:46 2020 +0100

    leaflet: give editor focus when closing sidebar
    
    And remove ineffective focus on closing sidebar.
    
    Change-Id: Iac6d46c91ca70949c73cd8cdb29416ecb80be409
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91017
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index a58766c21..67387016a 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1162,7 +1162,7 @@ L.Control.LokDialog = L.Control.extend({
 		}
 
 		$('#sidebar-dock-wrapper').css({display: ''});
-		if (this._map.editorHasFocus()) {
+		if (!this._map.editorHasFocus()) {
 			this._map.fire('editorgotfocus');
 			this._map.focus();
 		}
@@ -1218,7 +1218,6 @@ L.Control.LokDialog = L.Control.extend({
 				this._onSidebarClose(dialogId);
 			}
 		}
-		$('#sidebar-dock-wrapper').css({display: ''});
 	},
 
 	_onEditorGotFocus: function() {


More information about the Libreoffice-commits mailing list