Permalink
Browse files

Listview filter: Check if var listview is defined. Fixes #5696 and #5643



The listviewcreate event bubbles up which causes an error if a listview is nested in an UL or OL without data-role="listview".
1 parent 37445f6 commit c92a2bd5b30433f0f815b3bcebd4024c1e31948a @jaspermdegroot jaspermdegroot committed Feb 25, 2013
Showing with 1 addition and 2 deletions.
  1. +1 −2 js/widgets/listview.filter.js
@@ -20,11 +20,10 @@ var defaultFilterCallback = function( text, searchValue, item ) {
$.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
$.mobile.document.delegate( "ul, ol", "listviewcreate", function() {
-
var list = $( this ),
listview = list.data( "mobile-listview" );
- if ( !listview.options.filter ) {
+ if ( !listview || !listview.options.filter ) {
return;
}

0 comments on commit c92a2bd

Please sign in to comment.