Skip to content
This repository
Browse code

Replaced vclick and click .bind by the equivalent document.addEventLi…

…stener. This is to ensure that these handlers will be the first to run on vclick and click.

As of jQuery 1.7 delegated event handlers are run before bound handlers. This change ensure that these handlers are run before the ones handled by jQuery. Fixes #3686
  • Loading branch information...
commit b52d7cadf5518720766abdee38911d7ad4cab295 1 parent 3a90c79
Ghislain Seguin authored March 07, 2012

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  js/jquery.mobile.navigation.js
4  js/jquery.mobile.navigation.js
@@ -1211,7 +1211,7 @@ define( [
1211 1211
 		});
1212 1212
 
1213 1213
 		//add active state on vclick
1214  
-		$( document ).bind( "vclick", function( event ) {
  1214
+		document.addEventListener( $.support.touch?"touchstart":"click", function( event ) {
1215 1215
 			// if this isn't a left click we don't care. Its important to note
1216 1216
 			// that when the virtual event is generated it will create the which attr
1217 1217
 			if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
@@ -1243,7 +1243,7 @@ define( [
1243 1243
 		});
1244 1244
 
1245 1245
 		// click routing - direct to HTTP or Ajax, accordingly
1246  
-		$( document ).bind( "click", function( event ) {
  1246
+		document.addEventListener( "click", function( event ) {
1247 1247
 			if( !$.mobile.linkBindingEnabled ){
1248 1248
 				return;
1249 1249
 			}

0 notes on commit b52d7ca

Ghislain Seguin

This is not exactly equivalent but should work in our case since we use that handler to give visual feedback.

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