From 02f77491a186c30012b9705feb5aa7b1acbca513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Drouyer?= Date: Sun, 27 May 2012 14:52:41 +0300 Subject: [PATCH] Adding searchingText parameter allowing to do i18n... --- jquery.jsonSuggest-2.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jquery.jsonSuggest-2.js b/jquery.jsonSuggest-2.js index 3e6c45c..cb92d3a 100644 --- a/jquery.jsonSuggest-2.js +++ b/jquery.jsonSuggest-2.js @@ -54,7 +54,7 @@ * highlightMatches : [default true] This will add strong tags around the text that matches the search text in each result. * onSelect : [default undefined] Function that gets called once a result has been selected, gets passed in * the object version of the result as specified in the JSON data. - * + * searchingText : [default 'Searching...'] Text displayed when getting results. */ (function($) { @@ -71,7 +71,8 @@ maxHeight: 350, highlightMatches: true, onSelect: undefined, - width: undefined + width: undefined, + searchingText: 'Searching...' }, getJSONTimeout; settings = $.extend(defaults, settings); @@ -229,7 +230,7 @@ } else if (settings.url && typeof settings.url === 'string') { var text = this.value; - $(results).html('
  • Searching...
  • '). + $(results).html('
  • ' + settings.searchingText + '
  • '). show().css('height', 'auto'); getJSONTimeout = window.clearTimeout(getJSONTimeout);