Skip to content
This repository
Browse code

Conditionally add a live handler to kill clicks on .ui-disabled eleme…

…nts when CSS pointer-events property is not supported. Fixes #3558

Conflicts:

	js/jquery.mobile.init.js
  • Loading branch information...
commit 5ed6ae3b6bf4d40c48224ca98c2a7ea22544732b 1 parent e083da4
Ghislain Seguin authored June 20, 2012

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

  1. 13  js/jquery.mobile.init.js
13  js/jquery.mobile.init.js
@@ -192,6 +192,19 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
192 192
 		// window load event
193 193
 		// hide iOS browser chrome on load
194 194
 		$window.load( $.mobile.silentScroll );
  195
+
  196
+		if ( !$.support.cssPointerEvents ) {
  197
+			// IE and Opera don't support CSS pointer-events: none that we use to disable link-based buttons
  198
+			// by adding the 'ui-disabled' class to them. Using a JavaScript workaround for those browser.
  199
+			// https://github.com/jquery/jquery-mobile/issues/3558
  200
+
  201
+			$( document ).delegate( ".ui-disabled", "vclick",
  202
+				function( e ) {
  203
+					e.preventDefault();
  204
+					e.stopImmediatePropagation();
  205
+				}
  206
+			);
  207
+		}
195 208
 	});
196 209
 }( jQuery, this ));
197 210
 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);

0 notes on commit 5ed6ae3

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