New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activeBtnClass never be removed when Ajax link handling is disabled #2017

Closed
arcatdmz opened this Issue Jul 3, 2011 · 5 comments

Comments

Projects
None yet
4 participants
@arcatdmz

arcatdmz commented Jul 3, 2011

When $.mobile.ajaxEnabled === false, $.mobile.activeBtnClass won't be removed from the clicked link after page transition is completed. Related code seems to be jquery.mobile.navigation.js.

As far as I know, $.mobile.activeBtnClass is added to the link in the vclick event handler and is removed after the page transition in the removeActiveLinkClass that requires $activeClickedLink to be set properly.
The $activeClickedLink is set in the click event handler at L1093, which is unreachable when $.mobile.ajaxEnabled === false since it's after if statement at L1041.

To my thinking, fundamental solution is to move the line to set $activeClickedLink just before the if statement.

Current adhoc solution is writing code like:

$(document).bind("changepage", function(){
    $("."+$.mobile.activeBtnClass).removeClass($.mobile.activeBtnClass);
});
@idrake

This comment has been minimized.

Show comment
Hide comment
@idrake

idrake Jul 5, 2011

That worked like a charm.

idrake commented Jul 5, 2011

That worked like a charm.

@idrake

This comment has been minimized.

Show comment
Hide comment
@idrake

idrake Jul 5, 2011

Oh, I should mention I was having the same issue with ajaxEnabled == true.

Here's the details of the issue as I see it:

Page1 loads, user clicks on link to page2
on Page2 in the pageShow event, the user is conditionally directed to Page3. This is done by calling the anchors click function to simulate the user clicking the default option on the page. Doing this in the pageShow event messes up the active link tracking.

idrake commented Jul 5, 2011

Oh, I should mention I was having the same issue with ajaxEnabled == true.

Here's the details of the issue as I see it:

Page1 loads, user clicks on link to page2
on Page2 in the pageShow event, the user is conditionally directed to Page3. This is done by calling the anchors click function to simulate the user clicking the default option on the page. Doing this in the pageShow event messes up the active link tracking.

@ghost ghost assigned gseguin Jul 7, 2011

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Aug 18, 2011

Contributor

A related issue is that if Ajax is enabled, if you click a button or listview item, it gets the active state. If Ajax is slow, you can click other items and they all get the active state so it feel broken. We should clear all other active states and kill the older requests (ignore 'em).

Contributor

toddparker commented Aug 18, 2011

A related issue is that if Ajax is enabled, if you click a button or listview item, it gets the active state. If Ajax is slow, you can click other items and they all get the active state so it feel broken. We should clear all other active states and kill the older requests (ignore 'em).

@gseguin

This comment has been minimized.

Show comment
Hide comment
@gseguin

gseguin Sep 1, 2011

Member

@toddparker did you mean killing the ajax requests or just the visual state?

Member

gseguin commented Sep 1, 2011

@toddparker did you mean killing the ajax requests or just the visual state?

gseguin added a commit that referenced this issue Sep 1, 2011

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Sep 1, 2011

Contributor

@gseguin - The visual feedback for sure, but if i click 3 list items, i think we should transition to the latest click and just ignore the earlier requests. That part may be hard but the visual bit is at least a good first step. Looks very broken on slow connections if we have multiple active states.

Contributor

toddparker commented Sep 1, 2011

@gseguin - The visual feedback for sure, but if i click 3 list items, i think we should transition to the latest click and just ignore the earlier requests. That part may be hard but the visual bit is at least a good first step. Looks very broken on slow connections if we have multiple active states.

@toddparker toddparker closed this Sep 1, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment