Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
move to hasClass check to avoid psuedo selector slowdown
  • Loading branch information
johnbender committed Nov 21, 2011
1 parent 9d6ca3c commit c804280
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/jquery.mobile.navbar.js
Expand Up @@ -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 );
}
});
}
});
Expand Down

0 comments on commit c804280

Please sign in to comment.