Make navigation feel more responsive through feedback, even though it actually uses the click event again for actual page changes.

- set active state on all button vclick events
- cancelled vclick on slider switch handles so it's not too sticky.
- removed addClass in navigation.js as the first change handles it there.
This commit is contained in:
scottjehl 2011-04-07 14:41:45 -04:00
parent 9a1b2dcb3c
commit 982b7d4b15
3 changed files with 6 additions and 2 deletions

View file

@ -98,6 +98,9 @@ var attachEvents = function() {
"vmouseout blur": function() {
var theme = $(this).attr( "data-" + $.mobile.ns + "theme" );
$(this).removeClass( "ui-btn-hover-" + theme ).addClass( "ui-btn-up-" + theme );
},
"vclick": function() {
$(this).addClass( $.mobile.activeBtnClass );
}
});

View file

@ -132,7 +132,8 @@ $.widget( "mobile.slider", $.mobile.widget, {
this.handle
.bind( "vmousedown", function(){
$(this).focus();
});
})
.bind( "vclick", false );
this.handle
.bind( "keydown", function( event ) {

View file

@ -747,7 +747,7 @@
return;
}
$activeClickedLink = $this.closest( ".ui-btn" ).addClass( $.mobile.activeBtnClass );
$activeClickedLink = $this.closest( ".ui-btn" );
if( isExternal || hasAjaxDisabled || hasTarget || !$.mobile.ajaxEnabled ||
// TODO: deprecated - remove at 1.0