Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes #4220 - Collapsible - add active state on tap #4314

Merged
merged 1 commit into from

2 participants

@jasondscott

Milestone: 1.1.1
Fixes: #4220
How fixed: Added the active button state on tap of a collapsible heading
How Tested: Docs and http://jsbin.com/omacox/100

Jason Scott Fixes #4220 - Collapsible - add active state on tap
Fixes: #4220
How fixed: Added the active button state on tap of a collapsible heading
How Tested: Docs and http://jsbin.com/omacox/100
90dbbfe
@gseguin gseguin merged commit 3169b0d into jquery:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 8, 2012
  1. Fixes #4220 - Collapsible - add active state on tap

    Jason Scott authored
    Fixes: #4220
    How fixed: Added the active button state on tap of a collapsible heading
    How Tested: Docs and http://jsbin.com/omacox/100
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 js/jquery.mobile.collapsible.js
View
8 js/jquery.mobile.collapsible.js
@@ -107,7 +107,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
.end()
.find( ".ui-icon" )
.toggleClass( "ui-icon-" + expandedIcon, !isCollapse )
- .toggleClass( "ui-icon-" + collapsedIcon, isCollapse );
+ .toggleClass( "ui-icon-" + collapsedIcon, isCollapse )
+ .end()
+ .find( "a" ).first().removeClass( $.mobile.activeBtnClass );
$this.toggleClass( "ui-collapsible-collapsed", isCollapse );
collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
@@ -124,6 +126,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
.trigger( o.collapsed ? "collapse" : "expand" );
collapsibleHeading
+ .bind( "tap", function( event ) {
+ collapsibleHeading.find( "a" ).first().addClass( $.mobile.activeBtnClass );
+ })
.bind( "click", function( event ) {
var type = collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ?
@@ -132,6 +137,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
collapsible.trigger( type );
event.preventDefault();
+ event.stopPropagation();
});
}
});
Something went wrong with that request. Please try again.