[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Mon Aug 14 15:42:37 UTC 2017


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

New commits:
commit 23a4a887f2ce1102d802837851efd85c1fd9d9d9
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Aug 11 22:32:34 2017 +0530

    loleaflet: activate the inactivity timer after document load
    
    The timer is cancelled right after 'statusindicator' is received, so a
    document never really go to inactive mode after set inactivity time
    period (unless user refocuses the document). Call _activate() to ensure
    that timer is started after document is completely loaded.
    
    Also timer shouldn't really start when the document is not yet loaded.
    
    Change-Id: I58f5d7718c65cc37da9c3feb99ee6b16741a22a2
    (cherry picked from commit 8c74d4a38d0fc13e859ea0e936fca0102a0e9d0d)
    Reviewed-on: https://gerrit.libreoffice.org/41058
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 5d6f08a2..3d80e4ba 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -152,14 +152,16 @@ L.Map = L.Evented.extend({
 		}, this);
 
 		this.on('docloaded', function(e) {
-			if (e.status) {
+			this._docLoaded = e.status;
+			if (this._docLoaded) {
 				// so that dim timer starts from now()
 				this.lastActiveTime = Date.now();
 				if (!document.hasFocus()) {
 					this._deactivate();
+				} else {
+					this._activate();
 				}
 			}
-			this._docLoaded = e.status;
 		}, this);
 	},
 
@@ -906,7 +908,7 @@ L.Map = L.Evented.extend({
 	},
 
 	_startInactiveTimer: function () {
-		if (this._serverRecycling || this._documentIdle) {
+		if (this._serverRecycling || this._documentIdle || !this._docLoaded) {
 			return;
 		}
 


More information about the Libreoffice-commits mailing list