Skip to content

Commit

Permalink
Filterable: Add a data-no-filter attribute
Browse files Browse the repository at this point in the history
Add a data-no-filter attribute for an item such that it will always show in both normal and reveal mode when its data-no-filter="true"

Closes jquery-archivegh-8184
  • Loading branch information
carsonip committed Jul 6, 2015
1 parent d04308f commit bb3080a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/widgets/filterable.js
Expand Up @@ -92,7 +92,7 @@ $.widget( "mobile.filterable", {
},

_filterItems: function( val ) {
var idx, callback, length, dst,
var idx, callback, length, dst, noFilter,
show = [],
hide = [],
opts = this.options,
Expand All @@ -104,7 +104,8 @@ $.widget( "mobile.filterable", {

// Partition the items into those to be hidden and those to be shown
for ( idx = 0 ; idx < length ; idx++ ) {
dst = ( callback.call( filterItems[ idx ], idx, val ) ) ? hide : show;
noFilter = ( $.mobile.getAttribute( filterItems[ idx ], "no-filter" ) );
dst = ( !noFilter && callback.call( filterItems[ idx ], idx, val ) ) ? hide : show;
dst.push( filterItems[ idx ] );
}
}
Expand Down

0 comments on commit bb3080a

Please sign in to comment.