Skip to content


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

clyfe opened this Issue · 2 comments

2 participants


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.


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

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
@josh josh closed this issue from a commit
@josh josh Add `target` option and set as Event#relatedTarget
Deprecates `clickedElement`

Fixes #100
@josh josh closed this in b1e9880
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.