[Libreoffice-commits] online.git: loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 8 20:14:44 UTC 2018


 loleaflet/src/layer/marker/ClipboardContainer.js |    6 +++---
 loleaflet/src/layer/tile/TileLayer.js            |    4 ++--
 loleaflet/src/map/Map.js                         |    5 ++---
 loleaflet/src/map/handler/Map.Keyboard.js        |    4 ++--
 loleaflet/src/map/handler/Map.Mouse.js           |    2 +-
 5 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit a3284d92c609c0310e166c22ed6086637d8dcd92
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Sun Aug 5 16:39:03 2018 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Wed Aug 8 16:14:16 2018 -0400

    loleaflet: mobile: replace clipboardContainer with map focus
    
    Change-Id: I616e5b8417522ec06d7311f335d3c60888a32b82

diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js b/loleaflet/src/layer/marker/ClipboardContainer.js
index a6b2b159f..aa6d42a99 100644
--- a/loleaflet/src/layer/marker/ClipboardContainer.js
+++ b/loleaflet/src/layer/marker/ClipboardContainer.js
@@ -33,10 +33,10 @@ L.ClipboardContainer = L.Layer.extend({
 	},
 
 	focus: function(focus) {
-		if (focus) {
-			this._textArea.focus();
-		} else {
+		if (focus === false) {
 			this._textArea.blur();
+		} else {
+			this._textArea.focus();
 		}
 	},
 
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index e90459e43..2d2a25fb6 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -282,7 +282,7 @@ L.TileLayer = L.GridLayer.extend({
 		for (var key in this._selectionHandles) {
 			this._selectionHandles[key].on('drag dragend', this._onSelectionHandleDrag, this);
 		}
-		this._map._clipboardContainer.focus(true);
+		this._map.focus();
 
 		map.setPermission(this.options.permission);
 
@@ -1770,7 +1770,7 @@ L.TileLayer = L.GridLayer.extend({
 		}
 		if (e.type === 'dragend') {
 			e.target.isDragged = false;
-			this._map._clipboardContainer.focus(true);
+			this._map.focus();
 			this._map.fire('scrollvelocity', {vx: 0, vy: 0});
 		}
 
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 547915181..f29dbe4cb 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -661,7 +661,7 @@ L.Map = L.Evented.extend({
 		console.debug('focus:');
 		if (this._docLayer) {
 			console.debug('focus: focussing');
-			this._clipboardContainer.focus(true);
+			this._clipboardContainer.focus();
 		}
 	},
 
@@ -1064,8 +1064,7 @@ L.Map = L.Evented.extend({
 		// Calling from some other place with no real 'click' event doesn't work
 		if (type === 'click') {
 			if (this._permission === 'edit') {
-				this._clipboardContainer.focus(false);
-				this._clipboardContainer.focus(true);
+				this.focus();
 			}
 
 			// unselect if anything is selected already
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 4ccd5e7dc..18e49ad4e 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -230,7 +230,7 @@ L.Map.Keyboard = L.Handler.extend({
 		if (this._map._permission === 'edit') {
 			return;
 		}
-		this._map._container.focus();
+		this._map.focus();
 	},
 
 	// Convert javascript key codes to UNO key codes.
@@ -514,7 +514,7 @@ L.Map.Keyboard = L.Handler.extend({
 		case 93: // Right Cmd (Safari)
 			// we prepare for a copy or cut event
 			this._map._clipboardContainer.setValue(window.getSelection().toString());
-			this._map._clipboardContainer.focus(true);
+			this._map.focus();
 			this._map._clipboardContainer.select();
 			return true;
 		case 80: // p
diff --git a/loleaflet/src/map/handler/Map.Mouse.js b/loleaflet/src/map/handler/Map.Mouse.js
index b369497f6..a461d997a 100644
--- a/loleaflet/src/map/handler/Map.Mouse.js
+++ b/loleaflet/src/map/handler/Map.Mouse.js
@@ -151,7 +151,7 @@ L.Map.Mouse = L.Handler.extend({
 					var docLayer = this._map._docLayer;
 					this._mouseEventsQueue = [];
 					docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, buttons, modifier);
-					this._map._clipboardContainer.focus(true);
+					this._map.focus();
 				}, this));
 				this._holdMouseEvent = setTimeout(L.bind(this._executeMouseEvents, this), timeOut);
 


More information about the Libreoffice-commits mailing list