mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-02 11:54:43 +00:00
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:
parent
7406ea258a
commit
343161c972
2 changed files with 4 additions and 4 deletions
|
|
@ -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" : "" ) ) );
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue