Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4314 from jasondscott/responsiveCollapible

Fixes #4220 - Collapsible - add active state on tap
Conflicts:

	js/jquery.mobile.collapsible.js
  • Loading branch information...
commit 892611930d2d9881597e21cf4af2228d199f885a 1 parent 192223c
@gseguin gseguin authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 js/jquery.mobile.collapsible.js
View
8 js/jquery.mobile.collapsible.js
@@ -95,7 +95,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
.end()
.find( ".ui-icon" )
.toggleClass( "ui-icon-minus", !isCollapse )
- .toggleClass( "ui-icon-plus", isCollapse );
+ .toggleClass( "ui-icon-plus", 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 );
@@ -112,6 +114,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" ) ?
@@ -120,6 +125,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
collapsible.trigger( type );
event.preventDefault();
+ event.stopPropagation();
});
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.