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

Pranav Kant pranavk at collabora.co.uk
Wed Feb 28 14:05:49 UTC 2018


 loleaflet/dist/toolbar/toolbar.js |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 4c07c11cd6648b4c50c4cb74eee8efa8600903a0
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Feb 28 18:42:36 2018 +0530

    loleaflet: Fix 'Find' ergonomics; don't make 2nd ctrl+f bring findbar
    
    Change-Id: I82164555892324abf6eef2579bf1a99af510d10f

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 8d803d780..3c6a37bb0 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -724,7 +724,7 @@ $(function () {
 		onRefresh: function() {
 			$('#tb_toolbar-down_item_userlist .w2ui-tb-caption').addClass('loleaflet-font');
 			$('#search-input').off('input', onSearch).on('input', onSearch);
-			$('#search-input').off('keypress', onSearchKeyPress).on('keypress', onSearchKeyPress);
+			$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
 		}
 	});
 });
@@ -815,15 +815,15 @@ function onSearch() {
 	}
 }
 
-function onSearchKeyPress(e) {
-	if (e.keyCode === 13) { // Enter key
+function onSearchKeyDown(e) {
+	if ((e.keyCode === 71 && e.ctrlKey) || e.keyCode === 114 || e.keyCode === 13) {
 		if (e.shiftKey) {
-			// search backwards
 			map.search(L.DomUtil.get('search-input').value, true);
 		} else {
 			map.search(L.DomUtil.get('search-input').value);
 		}
-	} else if (e.keyCode === 27) { // Escape key
+		e.preventDefault();
+	} else if (e.keyCode === 27) {
 		_cancelSearch();
 	}
 }


More information about the Libreoffice-commits mailing list