Skip to content
Browse files

Revert "capture and retrigger clicks on the parent list item element …

…in navbars Fixes #4663"

This reverts commit b668b60.
  • Loading branch information...
1 parent 2732b47 commit 563c8873aababe56f71b9d86f3ed3775f89f57c9 @johnbender johnbender committed Aug 30, 2012
Showing with 4 additions and 35 deletions.
  1. +4 −24 js/widgets/navbar.js
  2. +0 −11 tests/unit/navbar/navbar_core.js
View
28 js/widgets/navbar.js
@@ -37,30 +37,10 @@ $.widget( "mobile.navbar", $.mobile.widget, {
iconpos: iconpos
});
- $navbar.delegate( "li", "vclick", function( event ) {
-
- // if the vclick was triggered on an anchor or the child
- // of an anchor (eg, ui-btn), grab the parent link
- var $link = $(event.target).closest( "a" );
-
- // if there isn't a parent link find the child link and trigger a click
- // this addresses Issue #4663 where the events are being triggered
- // on the parent element in fixed position navbars
- if( !$link.length ){
- $link = $( this ).children( "a" ).first();
- setTimeout(function() {
- $link.trigger( "click" );
- });
-
- return false;
- }
-
- // clear existing active button states
- $navbtns.removeClass( $.mobile.activeBtnClass );
-
- // if the target button isn't disabled
- if ( !$link.hasClass( "ui-disabled" ) ) {
- $link.addClass( $.mobile.activeBtnClass );
+ $navbar.delegate( "a", "vclick", function( event ) {
+ if ( !$(event.target).hasClass( "ui-disabled" ) ) {
+ $navbtns.removeClass( $.mobile.activeBtnClass );
+ $( this ).addClass( $.mobile.activeBtnClass );
}
});
View
11 tests/unit/navbar/navbar_core.js
@@ -28,15 +28,4 @@
$.mobile.ignoreContentEnabled = false;
});
-
- // Issue #4663
- asyncTest( "clicks/taps triggered on anything above the link get retriggered on the link", function() {
- expect( 1 );
- $( document ).delegate( "li", "vclick", function( event ) {
- ok($( event.target ).is("a"), "target should always be an anchor" );
- start();
- });
-
- $.mobile.activePage.find( "div:jqmData(role=navbar) li" ).first().trigger( "click" );
- });
})(jQuery);

0 comments on commit 563c887

Please sign in to comment.
Something went wrong with that request. Please try again.