Skip to content
This repository
Browse code

Introduced $.mobile.supportsTouch as a supported API and resuscitated…

… $.support.touch though it is still unsupported.

Fixes #4786
  • Loading branch information...
commit fbeeb5b82c65be3dfee39b8a9ce4df39bccf3f85 1 parent 0b32a26
Ghislain Seguin authored August 08, 2012
4  js/events/touch.js
@@ -3,7 +3,7 @@
3 3
 //>>label: touch
4 4
 //>>group: Events
5 5
 
6  
-define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
  6
+define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" ], function( $ ) {
7 7
 //>>excludeEnd("jqmBuildExclude");
8 8
 
9 9
 (function( $, window, undefined ) {
@@ -23,7 +23,7 @@ define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
23 23
 		}
24 24
 	});
25 25
 
26  
-	var supportTouch = "ontouchend" in document,
  26
+	var supportTouch = $.mobile.supportsTouch,
27 27
 		scrollEvent = "touchmove scroll",
28 28
 		touchStartEvent = supportTouch ? "touchstart" : "mousedown",
29 29
 		touchStopEvent = supportTouch ? "touchend" : "mouseup",
1  js/index.php
@@ -9,6 +9,7 @@
9 9
 	'jquery.ui.widget.js',
10 10
 	'jquery.mobile.widget.js',
11 11
 	'jquery.mobile.media.js',
  12
+	'jquery.mobile.support.touch.js',
12 13
 	'jquery.mobile.support.orientation.js',
13 14
 	'jquery.mobile.support.js',
14 15
 	'jquery.mobile.vmouse.js',
2  js/jquery.mobile.support.js
@@ -2,7 +2,7 @@
2 2
 //>>description: Assorted tests to qualify browsers by detecting features
3 3
 //>>label: Support Tests
4 4
 //>>group: Core
5  
-define( [  "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.orientation" ], function( $ ) {
  5
+define( [  "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.touch", "./jquery.mobile.support.orientation" ], function( $ ) {
6 6
 //>>excludeEnd("jqmBuildExclude");
7 7
 (function( $, undefined ) {
8 8
 
18  js/jquery.mobile.support.touch.js
... ...
@@ -0,0 +1,18 @@
  1
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
  2
+//>>description: Touch feature test
  3
+//>>label: Touch support test
  4
+//>>group: Core
  5
+
  6
+define( [ "jquery" ], function( jQuery ) {
  7
+//>>excludeEnd("jqmBuildExclude");
  8
+	(function( $, undefined ) {
  9
+		$.extend( $.support, {
  10
+			touch: "ontouchend" in document
  11
+		});
  12
+		$.extend( $.mobile, {
  13
+			supportsTouch: $.support.touch
  14
+		});
  15
+	}( jQuery ));
  16
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
  17
+});
  18
+//>>excludeEnd("jqmBuildExclude");

0 notes on commit fbeeb5b

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