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

Commit e07be5a

Browse files
Listview: Check if list item is already enhanced to improve performance of refresh.
1 parent aabdc93 commit e07be5a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

js/widgets/listview.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,13 @@ $.widget( "mobile.listview", $.mobile.widget, $.extend( {
101101
item = li.eq( pos );
102102
itemClass = "";
103103

104-
// TODO: Better way than !item.is( ".ui-listview > li" ) to prevent re-enhancemeent.
105-
if ( create || !item.is( ".ui-listview > li" ) ) {
104+
if ( create || item[ 0 ].className.search( /\bui-li-/ ) < 0 ) {
106105
a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
107106
isDivider = ( getAttr( item[ 0 ], "role", true ) === "list-divider" );
108107
value = item.attr( "value" );
109108
itemTheme = getAttr( item[ 0 ], "theme", true ) || o.theme;
110109

111-
if ( a.length && !isDivider ) {
110+
if ( a.length && a[ 0 ].className.search( /\bui-btn\b/ ) < 0 && !isDivider ) {
112111
itemIcon = getAttr( item[ 0 ], "icon", true );
113112
icon = ( itemIcon === false ) ? false : ( itemIcon || o.icon );
114113

0 commit comments

Comments
 (0)