diff --git a/js/jquery.mobile.buttonMarkup.js b/js/jquery.mobile.buttonMarkup.js index a17de316..a4c77d2d 100644 --- a/js/jquery.mobile.buttonMarkup.js +++ b/js/jquery.mobile.buttonMarkup.js @@ -83,21 +83,21 @@ $.fn.buttonMarkup.defaults = { var attachEvents = function() { $(".ui-btn:not(.ui-disabled)").live({ - "touchstart mousedown": function() { + "vmousedown": function() { var theme = $(this).attr( "data-theme" ); - $(this).removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme ); + $(this).removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme + " " + $.mobile.activeBtnClass); }, - "touchmove touchend mouseup": function() { + "vmousemove vmouseup": function() { var theme = $(this).attr( "data-theme" ); - $(this).removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme ); + $(this).removeClass( "ui-btn-down-" + theme + " " + $.mobile.activeBtnClass ).addClass( "ui-btn-up-" + theme ); }, - "mouseover focus": function() { + "vmouseover focus": function() { var theme = $(this).attr( "data-theme" ); $(this).removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme ); }, - "mouseout blur": function() { + "vmouseout blur": function() { var theme = $(this).attr( "data-theme" ); - $(this).removeClass( "ui-btn-hover-" + theme ).addClass( "ui-btn-up-" + theme ); + $(this).removeClass( "ui-btn-hover-" + theme + " " + $.mobile.activeBtnClass ).addClass( "ui-btn-up-" + theme ); } }); diff --git a/js/jquery.mobile.vmouse.js b/js/jquery.mobile.vmouse.js index 9d18cb7d..18b32dd9 100644 --- a/js/jquery.mobile.vmouse.js +++ b/js/jquery.mobile.vmouse.js @@ -216,6 +216,10 @@ function handleTouchStart(event) function handleScroll(event) { + if (!didScroll){ + triggerVirtualEvent("vmousecancel", event); + } + didScroll = true; startResetTimer(); } @@ -224,10 +228,14 @@ function handleTouchMove(event) { var t = getNativeEvent(event).touches[0]; + var didCancel = didScroll; didScroll = didScroll || (scrollTopSupported && (startScrollX != window.pageXOffset || startScrollY != window.pageYOffset)) || (Math.abs(t.pageX - startX) > scrollThreshold || Math.abs(t.pageY - startY) > scrollThreshold); + if (didScroll && !didCancel){ + triggerVirtualEvent("vmousecancel", event); + } triggerVirtualEvent("vmousemove", event); startResetTimer(); }