From 5847a02c9ce1e1e3831c9707afc789cfde3dc036 Mon Sep 17 00:00:00 2001 From: jlukic Date: Tue, 20 Jan 2015 17:15:21 -0500 Subject: [PATCH] Update release notes --- RELEASE-NOTES.md | 2 ++ src/definitions/modules/search.js | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 7f84eb023..c12a9ac3f 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -5,6 +5,8 @@ **Enhancements** - **API** - Added new behavior `$.api('abort')` which cancels current request +- **Search** - Search `onSelect` now recieves JSON object matching currently selected element, you can now programmatically retrieve result JSON using `.search('get result')`. Defaults to current value unless value specified as first parameter. +- **Search** - Search `onSelect` and `onResultsAdd` can now cancel default actions by returning `false`. - **Search** - Greatly reduced search delay from `300ms` to `100ms`. Previous request will automatically abort `xhr` when new request made **Bugs** diff --git a/src/definitions/modules/search.js b/src/definitions/modules/search.js index 3295a9e85..ee47c8996 100644 --- a/src/definitions/modules/search.js +++ b/src/definitions/modules/search.js @@ -149,7 +149,6 @@ $.fn.search = function(parameters) { result = module.get.result(name, results), returnedValue ; - console.log(result); if( $.isFunction(settings.onSelect) ) { if(settings.onSelect.call(element, result, results) === false) { module.debug('Custom onSelect callback cancelled default select action'); @@ -304,6 +303,7 @@ $.fn.search = function(parameters) { var result = false ; + value = value || module.get.value(); results = results || module.get.results(); if(settings.type === 'category') { module.debug('Finding result from category results', value); @@ -831,11 +831,12 @@ $.fn.search.settings = { verbose : true, performance : true, - // api config - apiSettings : false, type : 'standard', minCharacters : 1, + // api config + apiSettings : false, + source : false, searchFields : [ 'title',