Permalink
Browse files

move to hasClass check to avoid psuedo selector slowdown

  • Loading branch information...
johnbender committed Nov 15, 2011
1 parent 9d6ca3c commit c80428062aadeeb549ec532be330d9bfff75682d
Showing with 5 additions and 3 deletions.
  1. +5 −3 js/jquery.mobile.navbar.js
@@ -33,9 +33,11 @@ $.widget( "mobile.navbar", $.mobile.widget, {
iconpos: iconpos
});
$navbar.delegate( "a:not(.ui-disabled)", "vclick", function( event ) {
$navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
$( this ).addClass( $.mobile.activeBtnClass );
$navbar.delegate( "a", "vclick", function( event ) {
if( !$(event.target).hasClass("ui-disabled") ) {
$navbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
$( this ).addClass( $.mobile.activeBtnClass );
}
});
}
});

0 comments on commit c804280

Please sign in to comment.