mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
further performance optimization:
- hiding all elements at once
This commit is contained in:
parent
9cb8673e68
commit
b10c71814c
1 changed files with 4 additions and 7 deletions
|
|
@ -48,21 +48,18 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
|
|||
item = $(listItems[i]);
|
||||
itemtext=item.jqmData('filtertext') || item.text();
|
||||
if (item.is("li:jqmData(role=list-divider)")) {
|
||||
if (!childItems) {
|
||||
item.hide();
|
||||
}else{
|
||||
item.show();
|
||||
}
|
||||
item.toggleClass('ui-filter-hidequeue',!childItems);
|
||||
// New bucket!
|
||||
childItems = false;
|
||||
} else if (itemtext.toLowerCase().indexOf( val ) === -1) {
|
||||
item.hide();
|
||||
item.toggleClass('ui-filter-hidequeue',true);
|
||||
} else {
|
||||
item.show();
|
||||
// There's a shown item in the bucket
|
||||
childItems = true;
|
||||
}
|
||||
}
|
||||
listItems.filter(':not(.ui-filter-hidequeue)').show();
|
||||
listItems.filter('.ui-filter-hidequeue').hide().toggleClass('ui-filter-hidequeue',false);
|
||||
}else{
|
||||
listItems.show();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue