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

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 7 11:14:04 UTC 2019


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

New commits:
commit 58b4734f9e18b652bfc0eee8e1fef476e5dd62d7
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Jun 18 12:00:15 2019 -0400
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Thu Nov 7 12:13:46 2019 +0100

    leaflet: focus the editor after loading
    
    This is a combination of 3 commits.
    This is the 1st commit:
    
    leaflet: focus the editor after loading
    
    We might not have the input focus after
    loading the document, so we make sure we
    do grab it so the user can type immediately
    into the document without clicking in it.
    
    This is the commit #2:
    
    leaflet: focus the editor after loading - fixing recursion.
    
    Grim recursion causing stack overflow and worse:
    
    _activate (Map.js:1092)
    _onGotFocus (Map.js:1253)
    (anonymous) (Map.js:256)
    fire (Events.js:146)
    close (Socket.js:106)
    connect (Socket.js:45)
    loadDocument (Map.js:261)
    _activate (Map.js:1092)
    
    Makes re-connection when server re-cycles work again.
    
    This is the commit #3:
    
    leaflet: focus the editor after loading - fixing madness.
    (cherry picked from commit 983005ff5763e78cdd5400df60e3bc9600a3e961)
    
    Change-Id: I875750e85063101853fc65c75f322e82e09c3320
    Reviewed-on: https://gerrit.libreoffice.org/82149
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index f336d1c7f..f970ebf45 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -273,13 +273,12 @@ L.Map = L.Evented.extend({
 		this.on('docloaded', function(e) {
 			this._docLoaded = e.status;
 			if (this._docLoaded) {
-				// so that dim timer starts from now()
-				this.lastActiveTime = Date.now();
+				this.notifyActive();
 				if (!document.hasFocus()) {
-					this._deactivate();
-				} else {
-					this._activate();
+					this.fire('editorgotfocus');
+					this.focus();
 				}
+				this._activate();
 			} else if (this._docLayer) {
 				// remove the comments and changes
 				this._docLayer.clearAnnotations();


More information about the Libreoffice-commits mailing list