summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2020-01-18 11:15:07 -0500
committerJan Holesovsky <kendy@collabora.com>2020-01-28 18:10:14 +0100
commitaa921021007a8b49066dec5375b65e8a9bb4ba71 (patch)
tree6e22468c24f99c93e254fe039fa14e80421cfdfb
parentleaflet: change focus on rendering dialogs (diff)
downloadonline-aa921021007a8b49066dec5375b65e8a9bb4ba71.tar.gz
online-aa921021007a8b49066dec5375b65e8a9bb4ba71.zip
leaflet: focus the dialog/sidebar even when the cursor is not visible
Change-Id: I96963957986ba29cc55670dd6ef79a0bf39a9132
-rw-r--r--loleaflet/src/control/Control.LokDialog.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 13b261e5e4..9804e5d654 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -409,7 +409,7 @@ L.Control.LokDialog = L.Control.extend({
}
this._map.setWinId(dlgId);
- if (dlgId in this._dialogs && this._dialogs[dlgId].cursorVisible) {
+ if (dlgId in this._dialogs) {
this._map.focus();
} else {
this._map.blur();
@@ -964,6 +964,8 @@ L.Control.LokDialog = L.Control.extend({
if (e.winId === 0) {
// We lost the focus.
this._onEditorGotFocus();
+ } else {
+ this.focus(e.winId);
}
},
@@ -1027,7 +1029,7 @@ L.Control.LokDialog = L.Control.extend({
// if dialog is hidden, show it
if (container)
- $(container).parent().show();
+ $(container).parent().show();
if (parentId in that._dialogs) {
// We might have closed the dialog by the time we render.
@@ -1041,11 +1043,12 @@ L.Control.LokDialog = L.Control.extend({
// Binary dialog msg recvd from core
_onDialogPaint: function (e) {
- var parentId = this._getParentId(e.id);
+ var id = parseInt(e.id);
+ var parentId = this._getParentId(id);
if (parentId) {
this._paintDialogChild(parentId, e.img);
} else {
- this._paintDialog(e.id, e.rectangle, e.img);
+ this._paintDialog(id, e.rectangle, e.img);
}
},