Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Active state logic #5837

Closed
wants to merge 2 commits into from

1 participant

@jaspermdegroot
Collaborator

In navigation we prevent the active state being applied to button-style links with href="#" and in the navbar widget we have code to make that work again.

This causes all kind of issues with the navbar. See #1181 and #5707 which have been fixed with a workaround.

Besides this there have been a few feature requests for making those buttons getting the active state. See #5009 and #4469. This was just partly fixed by #5337.

@jaspermdegroot
Collaborator

I only tested navigation and navbar. The custom selects tests fail. Will look into that first.

@jaspermdegroot
Collaborator

Going to give this another look when we work on the navbar widget for 1.4. Closing this PR but keeping the branch alive.

@jaspermdegroot jaspermdegroot deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 1, 2013
  1. @jaspermdegroot
  2. @jaspermdegroot

    Navbar: removed active state logic that was only needed because we pr…

    jaspermdegroot authored
    …event navigation from adding the active state.
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 20 deletions.
  1. +0 −3  js/jquery.mobile.navigation.js
  2. +0 −17 js/widgets/navbar.js
View
3  js/jquery.mobile.navigation.js
@@ -1113,9 +1113,6 @@ define( [
}
} else {
target = findClosestLink( target );
- if ( !( target && path.parseUrl( target.getAttribute( "href" ) || "#" ).hash !== "#" ) ) {
- return;
- }
// TODO teach $.mobile.hijackable to operate on raw dom elements so the
// link wrapping can be avoided
View
17 js/widgets/navbar.js
@@ -37,23 +37,6 @@ $.widget( "mobile.navbar", $.mobile.widget, {
iconpos: iconpos
});
- $navbar.delegate( "a", "vclick", function( event ) {
- // ui-btn-inner is returned as target
- var target = $( event.target ).is( "a" ) ? $( this ) : $( this ).parent( "a" );
-
- if ( !target.is( ".ui-disabled, .ui-btn-active" ) ) {
- $navbtns.removeClass( $.mobile.activeBtnClass );
- $( this ).addClass( $.mobile.activeBtnClass );
-
- // The code below is a workaround to fix #1181
- var activeBtn = $( this );
-
- $( document ).one( "pagehide", function() {
- activeBtn.removeClass( $.mobile.activeBtnClass );
- });
- }
- });
-
// Buttons in the navbar with ui-state-persist class should regain their active state before page show
$navbar.closest( ".ui-page" ).bind( "pagebeforeshow", function() {
$navbtns.filter( ".ui-state-persist" ).addClass( $.mobile.activeBtnClass );
Something went wrong with that request. Please try again.