[Libreoffice-commits] online.git: Branch 'libreoffice-6-3' - 2 commits - loleaflet/src
Michael Meeks (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 7 09:36:37 UTC 2019
loleaflet/src/control/Control.AlertDialog.js | 2 +-
loleaflet/src/map/Map.js | 8 ++++++--
loleaflet/src/map/handler/Map.Keyboard.js | 3 +++
loleaflet/src/map/handler/Map.Mouse.js | 1 +
4 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit a04c6926d4be31130ea13bccb8a4e7b95893ed50
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Jun 6 20:43:27 2019 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Jun 7 10:20:51 2019 +0100
Be more aggressive about updating last active time.
Change-Id: I5d269dfe0114fadf41359baa90ceeac4726171e5
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index c1eba3297..2cff2fecc 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1071,6 +1071,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
@@ -1194,9 +1198,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;
commit 8d48e004ffe0c346d0aa18224001a6a400d5bcd8
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Jun 6 12:31:59 2019 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Jun 7 10:20:43 2019 +0100
When dismissing a dialog use afterClose to re-focus map.
It seems beforeClose is used by vex itself to emit the callback.
diff --git a/loleaflet/src/control/Control.AlertDialog.js b/loleaflet/src/control/Control.AlertDialog.js
index d0bd78339..1e1267649 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -64,7 +64,7 @@ L.Control.AlertDialog = L.Control.extend({
showCloseButton: true,
buttons: buttonsList,
callback: function() {},
- beforeClose: function () {
+ afterClose: function () {
e.map.focus();
e.map.enable(true);
}
More information about the Libreoffice-commits
mailing list