Ensured the hover delay only applies to touch devices, logic that was mysteriously absent from my previous commit.

This commit is contained in:
Mat Marquis 2011-12-30 15:58:56 -05:00 committed by scottjehl
parent 00b328b6cb
commit 6e5d454880

View file

@ -141,9 +141,14 @@ var attachEvents = function() {
if ( btn ) {
$btn = $( btn );
theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
hov = setTimeout(function() {
if( $.support.touch ) {
hov = setTimeout(function() {
$btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
}, hoverDelay );
} else {
$btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
}, hoverDelay );
}
}
},
"vmousecancel vmouseup": function( event ) {
@ -159,18 +164,24 @@ var attachEvents = function() {
"vmouseover focus": function( event ) {
var btn = closestEnabledButton( event.target ),
$btn, theme;
if ( btn ) {
$btn = $( btn );
theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
foc = setTimeout(function() {
if( $.support.touch ) {
foc = setTimeout(function() {
$btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
}, hoverDelay );
} else {
$btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
}, hoverDelay );
}
}
},
"vmouseout blur scrollstart": function( event ) {
var btn = closestEnabledButton( event.target ),
$btn, theme;
if ( btn ) {
$btn = $( btn );
theme = $btn.attr( "data-" + $.mobile.ns + "theme" );