mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-17 06:20:26 +00:00
Got rid of pseudo selectors :header and :eq(0) since they take a long time on WP7.5 (Mango). This shaves off 300 msecs when loading the form gallery page.
This commit is contained in:
parent
8fb55a8afa
commit
8e23813d25
1 changed files with 11 additions and 8 deletions
|
|
@ -11,7 +11,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
expandCueText: " click to expand contents",
|
||||
collapseCueText: " click to collapse contents",
|
||||
collapsed: true,
|
||||
heading: ">:header,>legend",
|
||||
heading: "h1,h2,h3,h4,h5,h6,legend",
|
||||
theme: null,
|
||||
contentTheme: null,
|
||||
iconTheme: "d",
|
||||
|
|
@ -22,7 +22,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
var $el = this.element,
|
||||
o = this.options,
|
||||
collapsible = $el.addClass( "ui-collapsible" ),
|
||||
collapsibleHeading = $el.find( o.heading ).eq( 0 ),
|
||||
collapsibleHeading = $el.children( o.heading ).first(),
|
||||
collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).find( ".ui-collapsible-content" ),
|
||||
collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ),
|
||||
colllapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" );
|
||||
|
|
@ -54,7 +54,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
.addClass( "ui-collapsible-heading" )
|
||||
.append( "<span class='ui-collapsible-heading-status'></span>" )
|
||||
.wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
|
||||
.find( "a:eq(0)" )
|
||||
.find( "a" )
|
||||
.first()
|
||||
.buttonMarkup({
|
||||
shadow: false,
|
||||
corners: false,
|
||||
|
|
@ -65,7 +66,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
|
||||
if ( !collapsibleSet.length ) {
|
||||
collapsibleHeading
|
||||
.find( "a:eq(0), .ui-btn-inner" )
|
||||
.find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
|
||||
.addClass( "ui-corner-top ui-corner-bottom" );
|
||||
} else {
|
||||
// If we are in a collapsible set
|
||||
|
|
@ -86,14 +87,16 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
}
|
||||
|
||||
colllapsiblesInSet.first()
|
||||
.find( "a:eq(0)" )
|
||||
.find( "a" )
|
||||
.first()
|
||||
.addClass( "ui-corner-top" )
|
||||
.find( ".ui-btn-inner" )
|
||||
.addClass( "ui-corner-top" );
|
||||
|
||||
colllapsiblesInSet.last()
|
||||
.jqmData( "collapsible-last", true )
|
||||
.find( "a:eq(0)" )
|
||||
.find( "a" )
|
||||
.first()
|
||||
.addClass( "ui-corner-bottom" )
|
||||
.find( ".ui-btn-inner" )
|
||||
.addClass( "ui-corner-bottom" );
|
||||
|
|
@ -101,7 +104,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
|
||||
if ( collapsible.jqmData( "collapsible-last" ) ) {
|
||||
collapsibleHeading
|
||||
.find( "a:eq(0), .ui-btn-inner" )
|
||||
.find( "a" ).first().add ( collapsibleHeading.find( ".ui-btn-inner" ) )
|
||||
.addClass( "ui-corner-bottom" );
|
||||
}
|
||||
}
|
||||
|
|
@ -131,7 +134,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
|
||||
if ( contentTheme && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) {
|
||||
collapsibleHeading
|
||||
.find( "a:eq(0), .ui-btn-inner" )
|
||||
.find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
|
||||
.toggleClass( "ui-corner-bottom", isCollapse );
|
||||
collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue