From 96737fcd49d2da05c78d4e854e2711ada3ab844b Mon Sep 17 00:00:00 2001 From: Carson Ip Date: Mon, 6 Jul 2015 22:20:49 +0800 Subject: [PATCH] Component: Filterable Add a data-no-filter attribute for an item such that it will always show under both normal and reveal mode. Closes gh-8184 --- js/widgets/filterable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/widgets/filterable.js b/js/widgets/filterable.js index 888d830bdbc..8b8cb919ec8 100644 --- a/js/widgets/filterable.js +++ b/js/widgets/filterable.js @@ -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, @@ -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 ] ); } }