Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move to hasClass check to avoid psuedo selector slowdown

  • Loading branch information...
commit c80428062aadeeb549ec532be330d9bfff75682d 1 parent 9d6ca3c
@johnbender johnbender authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 js/jquery.mobile.navbar.js
View
8 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 );
+ }
});
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.