Permalink
Browse files

Added check for custom filter callback presence; always check all ite…

…ms for filter if present.
  • Loading branch information...
cjindustries committed Apr 20, 2012
1 parent 5df40b2 commit dc94b00b74ac7219d0f5fa83341e49c7107531cb
Showing with 7 additions and 2 deletions.
  1. +7 −2 js/jquery.mobile.listview.filter.js
@@ -43,11 +43,16 @@ $( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function(
itemtext = "",
item;
+ // Check if a custom filter callback applies
+ var isCustomFilterCallback = listview.options.filterCallback !=
+ $.mobile.listview.prototype.options.filterCallback;
+
// Change val as lastval for next execution
$this.jqmData( "lastval" , val );
- if ( val.length < lastval.length || val.indexOf(lastval) !== 0 ) {
+
+ if ( isCustomFilterCallback || ( val.length < lastval.length || val.indexOf(lastval) !== 0 ) ) {
- // Removed chars or pasted something totally different, check all items
+ // Custom filter callback applies, removed chars or pasted something totally different; check all items
listItems = list.children();
} else {

0 comments on commit dc94b00

Please sign in to comment.