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

Commit

Permalink
Listview: Do not compute .first() if there is only one anchor
Browse files Browse the repository at this point in the history
(cherry picked from commit 3d85609)
  • Loading branch information
Gabriel Schulhof committed May 29, 2014
1 parent ecd5be5 commit eaf53c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/widgets/listview.js
Expand Up @@ -145,11 +145,15 @@ $.widget( "mobile.listview", $.extend( {
.attr( "title", $.trim( last.getEncodedText() ) )
.addClass( altButtonClass )
.empty();

// Reduce to the first anchor, because only the first gets the buttonClass
a = a.first();
} else if ( icon ) {
buttonClass += " ui-btn-icon-right ui-icon-" + icon;
}

a.first().addClass( buttonClass );
// Apply buttonClass to the (first) anchor
a.addClass( buttonClass );
} else if ( isDivider ) {
dividerTheme = ( getAttr( item[ 0 ], "theme" ) || o.dividerTheme || o.theme );

Expand Down

0 comments on commit eaf53c6

Please sign in to comment.