Skip to content
This repository
Browse code

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
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
@@ -95,7 +95,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
95 95
 						.end()
96 96
 						.find( ".ui-icon" )
97 97
 							.toggleClass( "ui-icon-minus", !isCollapse )
98  
-							.toggleClass( "ui-icon-plus", isCollapse );
  98
+							.toggleClass( "ui-icon-plus", isCollapse )
  99
+						.end()
  100
+						.find( "a" ).first().removeClass( $.mobile.activeBtnClass );
99 101
 
100 102
 					$this.toggleClass( "ui-collapsible-collapsed", isCollapse );
101 103
 					collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
@@ -112,6 +114,9 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
112 114
 			.trigger( o.collapsed ? "collapse" : "expand" );
113 115
 
114 116
 		collapsibleHeading
  117
+			.bind( "tap", function( event ) {
  118
+				collapsibleHeading.find( "a" ).first().addClass( $.mobile.activeBtnClass );
  119
+			})
115 120
 			.bind( "click", function( event ) {
116 121
 
117 122
 				var type = collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ?
@@ -120,6 +125,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
120 125
 				collapsible.trigger( type );
121 126
 
122 127
 				event.preventDefault();
  128
+				event.stopPropagation();
123 129
 			});
124 130
 	}
125 131
 });

0 notes on commit 8926119

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