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

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 13 08:07:14 UTC 2019


 loleaflet/src/map/Map.js                  |    8 ++++++--
 loleaflet/src/map/handler/Map.Keyboard.js |    3 +++
 loleaflet/src/map/handler/Map.Mouse.js    |    1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit ff877742c71fc87e99234566d7d4dbeabd9b4004
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Jun 6 20:43:27 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jun 13 10:06:56 2019 +0200

    Be more aggressive about updating last active time.
    
    Change-Id: I5d269dfe0114fadf41359baa90ceeac4726171e5
    Reviewed-on: https://gerrit.libreoffice.org/73629
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 4aad141c5..a02528ca0 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1064,6 +1064,10 @@ L.Map = L.Evented.extend({
 		this._socket.sendMessage('userinactive');
 	},
 
+	notifyActive : function() {
+		this.lastActiveTime = Date.now();
+	},
+
 	_dimIfInactive: function () {
 		console.debug('_dimIfInactive: diff=' + (Date.now() - this.lastActiveTime));
 		if (this._docLoaded && // don't dim if document hasn't been loaded yet
@@ -1187,9 +1191,9 @@ L.Map = L.Evented.extend({
 	},
 
 	_handleDOMEvent: function (e) {
-		if (!this._docLayer || !this._loaded || !this._enabled || L.DomEvent._skipped(e)) { return; }
+		this.notifyActive();
 
-		this.lastActiveTime = Date.now();
+		if (!this._docLayer || !this._loaded || !this._enabled || L.DomEvent._skipped(e)) { return; }
 
 		// find the layer the event is propagating from
 		var target = this._targets[L.stamp(e.target || e.srcElement)],
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 4e3b51354..9ef49f1b9 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -234,6 +234,7 @@ L.Map.Keyboard = L.Handler.extend({
 	},
 
 	_onMouseDown: function () {
+		this._map.notifyActive();
 		if (this._map._permission === 'edit') {
 			return;
 		}
@@ -246,6 +247,7 @@ L.Map.Keyboard = L.Handler.extend({
 	},
 
 	_onKeyDown: function (e, keyEventFn, compEventFn, inputEle) {
+		this._map.notifyActive();
 		if (this._map.slideShow && this._map.slideShow.fullscreen) {
 			return;
 		}
@@ -399,6 +401,7 @@ L.Map.Keyboard = L.Handler.extend({
 	},
 
 	_onIME: function (e) {
+		this._map.notifyActive();
 		if (e.type === 'compositionstart') {
 			this._isComposing = true; // we are starting composing with IME
 		} else if (e.type === 'compositionupdate') {
diff --git a/loleaflet/src/map/handler/Map.Mouse.js b/loleaflet/src/map/handler/Map.Mouse.js
index 248ef9105..39d2cf722 100644
--- a/loleaflet/src/map/handler/Map.Mouse.js
+++ b/loleaflet/src/map/handler/Map.Mouse.js
@@ -38,6 +38,7 @@ L.Map.Mouse = L.Handler.extend({
 	},
 
 	_onMouseEvent: function (e) {
+		this._map.notifyActive();
 		var docLayer = this._map._docLayer;
 		if (!docLayer || (this._map.slideShow && this._map.slideShow.fullscreen) || this._map.rulerActive) {
 			return;


More information about the Libreoffice-commits mailing list