From 20f3f93fc5136be180ad630d3eb6d443144a79c7 Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Thu, 10 Jul 2014 14:11:00 +0000
Subject: [PATCH] SSDM-557: Search with less than 3 characters allowed with
 alert.

SVN: 32021
---
 .../newbrowser/html/js/controllers/MainController.js  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js
index 2491bd558c2..d9ef775705a 100644
--- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js
+++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js
@@ -414,9 +414,6 @@ function MainController(profile) {
 	
 	this._showSearchPage = function(value) {
 		//Only search with at least 3 characters
-		if(value.length < 3) {
-			return;
-		}
 		
 		this.lastSearchId++;
 		var localSearchId = this.lastSearchId;
@@ -424,6 +421,14 @@ function MainController(profile) {
 		
 		var possibleSearch = function() {
 			if(localSearchId === localReference.lastSearchId) { //Trigger it if no new have started
+				
+				if(value.length < 3) {
+					var isOk = window.confirm("Are you sure you want to make a search with " + value.length +" characters? You can expect a lot of results.");
+					if(!isOk) {
+						return;
+					}
+				}
+				
 				//Update Main Container
 				var sampleTable = new SampleTable(localReference.serverFacade, "mainContainer", localReference.profile, localReference.profile.searchType["TYPE"], true, false, false, true, false, localReference.inspector);
 				$("#search").addClass("search-query-searching");
-- 
GitLab