Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
clyfe opened this Issue · 2 comments

2 participants

Claudius Nicolae Joshua Peek
Claudius Nicolae

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.

Claudius Nicolae

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
Claudius Nicolae clyfe closed this
Joshua Peek
Collaborator

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.

Joshua Peek josh reopened this
Joshua Peek josh closed this issue from a commit
Joshua Peek josh Add `target` option and set as Event#relatedTarget
Deprecates `clickedElement`

Fixes #100
b1e9880
Joshua Peek 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.