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

Henry Castro hcastro at collabora.com
Wed Jun 10 19:02:24 PDT 2015


 loleaflet/src/layer/tile/TileLayer.js |    9 ++++++++-
 loleaflet/src/map/Map.js              |    4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit ba6663d4457932e604cd1e0dfba0e3218dce10e6
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Jun 10 21:59:09 2015 -0400

    loleaflet: Added onkeyup event.

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 24363c3..70750ec 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -81,7 +81,8 @@ L.TileLayer = L.GridLayer.extend({
 		var events = {
 			viewreset: this._viewReset,
 			moveend: this._move,
-			keypress: this._onKeyPress
+			keypress: this._onKeyPress,
+			keyup: this._onKeyUp
 		};
 
 		if (!this.options.updateWhenIdle) {
@@ -713,6 +714,12 @@ L.TileLayer = L.GridLayer.extend({
 		}
 	},
 
+	_onKeyUp: function (e) {
+		if (this._cursorMarker) {
+			this._postKeyboardEvent('up', e.originalEvent.charCode, this._toUNOKeyCode(e.originalEvent.keyCode));
+		}
+	},
+
 	_onUpdateCursor: function () {
 		if (this._cursorVisible && this._cursorBounds ) {
 			if (this._cursorMarker)
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 72a9c49..06b31b4 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -582,7 +582,7 @@ L.Map = L.Evented.extend({
 		var onOff = remove ? 'off' : 'on';
 
 		L.DomEvent[onOff](this._container, 'click dblclick mousedown mouseup ' +
-			'mouseover mouseout mousemove contextmenu keypress', this._handleDOMEvent, this);
+			'mouseover mouseout mousemove contextmenu keypress keyup', this._handleDOMEvent, this);
 
 		if (this.options.trackResize) {
 			L.DomEvent[onOff](window, 'resize', this._onResize, this);
@@ -635,7 +635,7 @@ L.Map = L.Evented.extend({
 		var data = {
 			originalEvent: e
 		};
-		if (e.type !== 'keypress') {
+		if (e.type !== 'keypress' && e.type !== 'keyup') {
 			data.containerPoint = target instanceof L.Marker ?
 					this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);
 			data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);


More information about the Libreoffice-commits mailing list