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

Already on GitHub? Sign in to your account

pjax:success should have event.relatedTarget set to DOM link that was clicked #100

clyfe opened this Issue Feb 29, 2012 · 2 comments


None yet
2 participants

clyfe commented Feb 29, 2012

All pjax:XXX events should be forwarding the DOM link that was clicked via event.relatedTarget so it can be used downstream if needed (for example active/inactive tabs and such).

This should be done fairly easy by modifying the handleClick function.

clyfe commented Feb 29, 2012

I followed the code more closely and I found it in options.clickedElement

$(document).on 'pjax:success', (event, data, status, xhr, options) ->
  console.log options.clickedElement

@clyfe clyfe closed this Feb 29, 2012


josh commented Feb 29, 2012

Actually, I really like the idea of using event.relatedTarget. It also bugs me that options.clickedElement is a jquery object, not an element. Good call.

@josh josh reopened this Feb 29, 2012

@josh josh closed this in b1e9880 Mar 1, 2012

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