[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-0' - loleaflet/src
Ashod Nakashian (via logerrit)
logerrit at kemper.freedesktop.org
Wed Feb 26 16:11:29 UTC 2020
loleaflet/src/control/Control.Toolbar.js | 5 +++--
loleaflet/src/layer/tile/TileLayer.js | 1 +
loleaflet/src/map/Map.js | 13 +++++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit 772dd0d30619561ad5d78aec086d4307e16ca001
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Tue Feb 11 08:34:04 2020 -0500
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Feb 26 17:11:11 2020 +0100
leaflet: fix searching in document functionality
This makes searching work again, but typing 'r'
still triggers F3, which simply matches the next
hit (on desktop, on mobile it works fine).
So (on desktop) typing 'your' will match the first 'you'
and the 'r' will move the search results to the
second 'you' (assuming there are at least two 'you'
entries in the document and one 'your').
Change-Id: Iab425afdfb3848ecff97f5599ceb7cae160b097d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89357
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 8ad7c4790c4a34d3e6a5ebfe5810b6cb00354acc)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89511
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 6c47153f2..95c36dedd 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1372,8 +1372,9 @@ function onSearchKeyPress(e) {
}
function onSearchFocus() {
- // hide the caret in the main document
- map._onLostFocus();
+ // Start searching.
+ map.fire('searchstart');
+
updateSearchButtons();
}
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index a0fff8280..3fb939a49 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2160,6 +2160,7 @@ L.TileLayer = L.GridLayer.extend({
if (this._map._permission === 'edit'
&& this._map._isCursorVisible // only when LOK has told us it is ok
&& this._map.editorHasFocus() // not when document is not focused
+ && !this._map.isSearching() // not when searching within the doc
&& !this._isZooming // not when zooming
// && !this.isGraphicVisible() // not when sizing / positioning graphics
&& !this._isEmptyRectangle(this._visibleCursor)) {
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index cd2c8aad1..4aa7fd7c7 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -120,6 +120,8 @@ L.Map = L.Evented.extend({
this._winId = 0;
// The object of the dialog, if any (must have .focus callable).
this._activeDialog = null;
+ // True only when searching within the doc, as we need to use winId==0.
+ this._isSearching = false;
vex.dialogID = -1;
@@ -248,6 +250,8 @@ L.Map = L.Evented.extend({
// Fired to signal that the input focus is being changed.
this.on('changefocuswidget', this._onChangeFocusWidget, this);
+ this.on('searchstart', this._onSearchStart, this);
+
// View info (user names and view ids)
this._viewInfo = {};
this._viewInfoByUserName = {};
@@ -947,6 +951,10 @@ L.Map = L.Evented.extend({
this.fire('hyperlinkclicked', {url: helpURL});
},
+ isSearching: function() {
+ return this._isSearching;
+ },
+
_fireInitComplete: function (condition) {
if (this.initComplete) {
return;
@@ -1358,6 +1366,7 @@ L.Map = L.Evented.extend({
this._winId = winId;
this._activeDialog = dialog;
+ this._isSearching = false;
var doclayer = this._docLayer;
if (doclayer)
@@ -1402,6 +1411,10 @@ L.Map = L.Evented.extend({
}
},
+ _onSearchStart: function () {
+ this._isSearching = true;
+ },
+
_onUpdateProgress: function (e) {
if (e.statusType === 'start') {
if (this._socket.socket.readyState === 1) {
More information about the Libreoffice-commits
mailing list