diff --git a/js/jquery.mobile.listview.filter.js b/js/jquery.mobile.listview.filter.js index 7b283397..b645ecc4 100644 --- a/js/jquery.mobile.listview.filter.js +++ b/js/jquery.mobile.listview.filter.js @@ -10,6 +10,9 @@ $.mobile.listview.prototype.options.filter = false; $.mobile.listview.prototype.options.filterPlaceholder = "Filter items..."; $.mobile.listview.prototype.options.filterTheme = "c"; +$.mobile.listview.prototype.options.filterCallback = function( text, searchValue ){ + return text.toLowerCase().indexOf( searchValue ) === -1; +}; $( ":jqmData(role='listview')" ).live( "listviewcreate", function() { @@ -70,7 +73,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() { // New bucket! childItems = false; - } else if ( itemtext.toLowerCase().indexOf( val ) === -1 ) { + } else if ( listview.options.filterCallback( itemtext, val ) ) { //mark to be hidden item.toggleClass( "ui-filter-hidequeue" , true );