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

Commit 3d85609

Browse files
author
Gabriel Schulhof
committed
Listview: Do not compute .first() if there is only one anchor
1 parent 9e082b0 commit 3d85609

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/widgets/listview.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,15 @@ $.widget( "mobile.listview", $.extend( {
145145
.attr( "title", $.trim( last.getEncodedText() ) )
146146
.addClass( altButtonClass )
147147
.empty();
148+
149+
// Reduce to the first anchor, because only the first gets the buttonClass
150+
a = a.first();
148151
} else if ( icon ) {
149152
buttonClass += " ui-btn-icon-right ui-icon-" + icon;
150153
}
151154

152-
a.first().addClass( buttonClass );
155+
// Apply buttonClass to the (first) anchor
156+
a.addClass( buttonClass );
153157
} else if ( isDivider ) {
154158
dividerTheme = ( getAttr( item[ 0 ], "theme" ) || o.dividerTheme || o.theme );
155159

0 commit comments

Comments
 (0)