Reclaim 250 msecs on iPad and WP7.5 (Mango) by simply combining find().filter() calls and getting rid of fake pseudo selectors :eq(0) and :last.

This commit is contained in:
jblas@adobe.com 2011-11-11 10:31:31 -08:00
parent 7406ea258a
commit 343161c972
2 changed files with 4 additions and 4 deletions

View file

@ -14,9 +14,9 @@ $.fn.controlgroup = function( options ) {
shadow: false,
excludeInvisible: true
}, options ),
groupheading = $el.find( ">legend" ),
groupheading = $el.children( "legend" ),
flCorners = o.direction == "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
type = $el.find( "input:eq(0)" ).attr( "type" );
type = $el.find( "input" ).first().attr( "type" );
// Replace legend with more stylable replacement div
if ( groupheading.length ) {
@ -33,7 +33,7 @@ $.fn.controlgroup = function( options ) {
els.removeClass( "ui-btn-corner-all ui-shadow" )
.eq( 0 ).addClass( flCorners[ 0 ] )
.end()
.filter( ":last" ).addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
.last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
}
flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ) );

View file

@ -14,7 +14,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
input = this.element,
// NOTE: Windows Phone could not find the label through a selector
// filter works though.
label = input.closest( "form,fieldset,:jqmData(role='page')" ).find( "label" ).filter( "[for='" + input[ 0 ].id + "']"),
label = input.closest( "form,fieldset,:jqmData(role='page')" ).find( "label[for='" + input[ 0 ].id + "']"),
inputtype = input.attr( "type" ),
checkedState = inputtype + "-on",
uncheckedState = inputtype + "-off",