Permalink
Browse files

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

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

Fixes #4786
  • Loading branch information...
gseguin committed Aug 8, 2012
1 parent 0b32a26 commit fbeeb5b82c65be3dfee39b8a9ce4df39bccf3f85
Showing with 22 additions and 3 deletions.
  1. +2 −2 js/events/touch.js
  2. +1 −0 js/index.php
  3. +1 −1 js/jquery.mobile.support.js
  4. +18 −0 js/jquery.mobile.support.touch.js
View
@@ -3,7 +3,7 @@
//>>label: touch
//>>group: Events
define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
define( [ "jquery", "../jquery.mobile.vmouse", "../jquery.mobile.support.touch" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, window, undefined ) {
@@ -23,7 +23,7 @@ define( [ "jquery", "../jquery.mobile.vmouse" ], function( $ ) {
}
});
var supportTouch = "ontouchend" in document,
var supportTouch = $.mobile.supportsTouch,
scrollEvent = "touchmove scroll",
touchStartEvent = supportTouch ? "touchstart" : "mousedown",
touchStopEvent = supportTouch ? "touchend" : "mouseup",
View
@@ -9,6 +9,7 @@
'jquery.ui.widget.js',
'jquery.mobile.widget.js',
'jquery.mobile.media.js',
'jquery.mobile.support.touch.js',
'jquery.mobile.support.orientation.js',
'jquery.mobile.support.js',
'jquery.mobile.vmouse.js',
@@ -2,7 +2,7 @@
//>>description: Assorted tests to qualify browsers by detecting features
//>>label: Support Tests
//>>group: Core
define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.orientation" ], function( $ ) {
define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.media", "./jquery.mobile.support.touch", "./jquery.mobile.support.orientation" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
@@ -0,0 +1,18 @@
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
//>>description: Touch feature test
//>>label: Touch support test
//>>group: Core
define( [ "jquery" ], function( jQuery ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.extend( $.support, {
touch: "ontouchend" in document
});
$.extend( $.mobile, {
supportsTouch: $.support.touch
});
}( jQuery ));
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");

0 comments on commit fbeeb5b

Please sign in to comment.