Permalink
Browse files

Listview: Do not compute .first() if there is only one anchor

(cherry picked from commit 3d85609)
  • Loading branch information...
gabrielschulhof committed Mar 8, 2014
1 parent ecd5be5 commit eaf53c68ba5edea6b75aa40755ce5ed80fa205b4
Showing with 5 additions and 1 deletion.
  1. +5 −1 js/widgets/listview.js
View
@@ -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 );

0 comments on commit eaf53c6

Please sign in to comment.