mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Some minor listview tweaking to eliminate 1200 $.fn.find calls in our 400 item listview test case.
- Moved some of the finds we used to do for every item, out of the processing loop so we do just 3 big finds. This shaves off 200-300ms on iPad iOS 4.3.5.
This commit is contained in:
parent
ebd7e04ce0
commit
e056d20728
1 changed files with 9 additions and 7 deletions
|
|
@ -43,14 +43,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
|
|||
}
|
||||
|
||||
// TODO class has to be defined in markup
|
||||
item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
|
||||
.find( "p, dl" ).addClass( "ui-li-desc" ).end()
|
||||
.find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
|
||||
item.find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
|
||||
item.addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
|
||||
}).end()
|
||||
.find( ".ui-li-aside" ).each(function() {
|
||||
var $this = $(this);
|
||||
$this.prependTo( $this.parent() ); //shift aside to front for css float
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -215,6 +209,14 @@ $.widget( "mobile.listview", $.mobile.widget, {
|
|||
self._itemApply( $list, item );
|
||||
}
|
||||
|
||||
$list.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
|
||||
.find( "p, dl" ).addClass( "ui-li-desc" ).end()
|
||||
.find( ".ui-li-aside" ).each(function() {
|
||||
var $this = $(this);
|
||||
$this.prependTo( $this.parent() ); //shift aside to front for css float
|
||||
});
|
||||
|
||||
|
||||
this._refreshCorners( create );
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue