Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Listview: Some small changes because we use class ui-li anymore but s…
Browse files Browse the repository at this point in the history
…till add class ui-btn.
  • Loading branch information
jaspermdegroot committed May 13, 2013
1 parent 6212b80 commit 9af0e9c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions js/widgets/listview.js
Expand Up @@ -116,8 +116,8 @@ $.widget( "mobile.listview", $.mobile.widget, $.extend( {
item = li.eq( pos );
itemClass = "";

// If we're creating the element, we update it regardless
if ( create || !item.hasClass( "ui-li" ) ) {
// TODO: Better way than !item.is( ".ui-listview > li" ) to prevent re-enhancemeent.
if ( create || !item.is( ".ui-listview > li" ) ) {
a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
isDivider = ( getAttr( item[ 0 ], "role", true ) === "list-divider" );
value = item.attr( "value" );
Expand Down Expand Up @@ -183,10 +183,9 @@ $.widget( "mobile.listview", $.mobile.widget, $.extend( {
$( itemClassDict[ itemClass ] ).addClass( itemClass );
}

$list
.find( ".ui-li-count" ).each(function() {
$( this ).closest( "li" ).addClass( "ui-li-has-count" );
}).addClass( "ui-fill-" + ( getAttr( $list[ 0 ], "counttheme", true ) || this.options.countTheme) + " ui-corner-all" );
$list.find( ".ui-li-count" ).each(function() {
$( this ).closest( "li" ).addClass( "ui-li-has-count" );
}).addClass( "ui-fill-" + ( getAttr( $list[ 0 ], "counttheme", true ) || this.options.countTheme) + " ui-corner-all" );

// The idea here is to look at the first image in the list item
// itself, and any .ui-link-inherit element it may contain, so we
Expand All @@ -201,7 +200,7 @@ $.widget( "mobile.listview", $.mobile.widget, $.extend( {
// opposed to 30 seconds.

this._addThumbClasses( li );
this._addThumbClasses( $list.find( "li > a" ) );
this._addThumbClasses( $list.find( "li > .ui-btn" ) );

this._addFirstLastClasses( li, this._getVisibles( li, create ), create );
// autodividers binds to this to redraw dividers after the listview refresh
Expand Down

0 comments on commit 9af0e9c

Please sign in to comment.