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

Aditya Dewan iit2015097 at iiita.ac.in
Wed Jun 21 10:02:23 UTC 2017


 loleaflet/dist/toolbar/toolbar.js        |   17 +++++++++++++----
 loleaflet/src/control/Control.Menubar.js |   12 +++++++-----
 2 files changed, 20 insertions(+), 9 deletions(-)

New commits:
commit 7a69dc16509cee56f1a90b459c8189c5cfb08add
Author: Aditya Dewan <iit2015097 at iiita.ac.in>
Date:   Sat Jun 17 08:48:13 2017 +0530

    disable search as type from the dialog box for calc/impress
    
    Change-Id: I93fa810876c405ea29521ecd90d4cf70affc7994
    Reviewed-on: https://gerrit.libreoffice.org/38904
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index b2657afb..a0d9a5b5 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -757,10 +757,19 @@ function selectItem(item, func)
 }
 function onSearch(e) {
 	var toolbar = w2ui['toolbar-down'];
-	map.search(L.DomUtil.get('search-input').value, false, '', 0, true /* expand search */);
-	toolbar.enable('searchprev');
-	toolbar.enable('searchnext');
-	toolbar.show('cancelsearch');
+	// conditionally disabling until, we find a solution for tdf#108577
+	if (L.DomUtil.get('search-input').value === '') {
+		toolbar.disable('searchprev');
+		toolbar.disable('searchnext');
+		toolbar.hide('cancelsearch');
+	}
+	else {
+		if(map.getDocType() === 'text')
+			map.search(L.DomUtil.get('search-input').value, false, '', 0, true /* expand search */);
+		toolbar.enable('searchprev');
+		toolbar.enable('searchnext');
+		toolbar.show('cancelsearch');
+	}
 }
 
 function onSearchKeyPress(e) {
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 71b9f774..af87725d 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -499,11 +499,13 @@ L.Control.Menubar = L.Control.extend({
 				var xElem = 0, yElem = 0;
 				var maxH = window.innerHeight, maxW = window.innerWidth;
 
-				$('#findthis').on('input', function() {
-					if (this.value.length != 0) {
-						map.search(this.value, false, '', 0, true);
-					}
-				});
+				if (map.getDocType() === 'text') {
+					$('#findthis').on('input', function() {
+						if (this.value.length != 0) {
+							map.search(this.value, false, '', 0, true);
+						}
+					});
+				}
 				$('.vex-content').on('mousedown', function(e) {
 					selected = this;
 					selected.style.cursor = 'move';


More information about the Libreoffice-commits mailing list