Skip to content
This repository
Browse code

Merge pull request #4314 from jasondscott/responsiveCollapible

Fixes #4220 - Collapsible - add active state on tap
  • Loading branch information...
commit 3169b0df80e06291875d499857139e8ab9f52ac0 2 parents 5ee7b0f + 90dbbfe
Ghislain Seguin authored May 10, 2012

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  js/jquery.mobile.collapsible.js
8  js/jquery.mobile.collapsible.js
@@ -107,7 +107,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
107 107
 						.end()
108 108
 						.find( ".ui-icon" )
109 109
 							.toggleClass( "ui-icon-" + expandedIcon, !isCollapse )
110  
-							.toggleClass( "ui-icon-" + collapsedIcon, isCollapse );
  110
+							.toggleClass( "ui-icon-" + collapsedIcon, isCollapse )
  111
+						.end()
  112
+						.find( "a" ).first().removeClass( $.mobile.activeBtnClass );
111 113
 
112 114
 					$this.toggleClass( "ui-collapsible-collapsed", isCollapse );
113 115
 					collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
@@ -124,6 +126,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
124 126
 			.trigger( o.collapsed ? "collapse" : "expand" );
125 127
 
126 128
 		collapsibleHeading
  129
+			.bind( "tap", function( event ) {
  130
+				collapsibleHeading.find( "a" ).first().addClass( $.mobile.activeBtnClass );
  131
+			})
127 132
 			.bind( "click", function( event ) {
128 133
 
129 134
 				var type = collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ?
@@ -132,6 +137,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
132 137
 				collapsible.trigger( type );
133 138
 
134 139
 				event.preventDefault();
  140
+				event.stopPropagation();
135 141
 			});
136 142
 	}
137 143
 });

0 notes on commit 3169b0d

Please sign in to comment.
Something went wrong with that request. Please try again.