Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[listview] Avoid filtering twice for ":visible"

  • Loading branch information...
commit aafd5f2336634a05691d20dc196ccc3dfd661d8a 1 parent c2f1e6e
@gabrielschulhof gabrielschulhof authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 js/widgets/listview.js
View
9 js/widgets/listview.js
@@ -55,7 +55,14 @@ $.widget( "mobile.listview", $.mobile.widget, {
lis.removeClass( "ui-first-child ui-last-child" );
// At create time and when autodividers calls refresh the li are not visible yet so we need to rely on .ui-screen-hidden
- visiblelis = create || lis.filter( ":visible" ).length === 0 ? lis.not( ".ui-screen-hidden" ) : lis.filter( ":visible" );
+ if ( create ) {
+ visiblelis = lis.not( ".ui-screen-hidden" );
+ } else {
+ visiblelis = lis.filter( ":visible" );
+ if ( visiblelis.length === 0 ) {
+ visiblelis = lis.not( ".ui-screen-hidden" );
+ }
+ }
visiblelis.eq( 0 ).addClass( "ui-first-child" ).end().last().addClass( "ui-last-child" );
Please sign in to comment.
Something went wrong with that request. Please try again.