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

Mihai Varga mihai.varga at collabora.com
Mon Jun 29 02:14:46 PDT 2015


 loleaflet/src/layer/tile/TileLayer.js |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 0c1a0b1b12c92358366659566a690a4a7dfdf6cf
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Mon Jun 29 12:14:26 2015 +0300

    Fix firefox backspace after handling it for chrome

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 9f95f3a..a8a51d1 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -806,11 +806,16 @@ L.TileLayer = L.GridLayer.extend({
 
 		var charCode = e.originalEvent.charCode;
 		var keyCode = e.originalEvent.keyCode;
+		// TODO handle browser differences
 		if (e.type === 'keydown' && keyCode === 8) {
 			// chrome backspace
 			this._postKeyboardEvent('input', charCode, this._toUNOKeyCode(keyCode));
 		}
 		else if (e.type === 'keypress') {
+			if (keyCode === 8) {
+				// backspace has already been handled
+				return;
+			}
 			if (charCode === keyCode && charCode !== 13) {
 				// Chrome sets keyCode = charCode for printable keys
 				// while LO requires it to be 0


More information about the Libreoffice-commits mailing list