Pass the element that triggered Pjax to the pjax:send event #94
Reference in New Issue
Block a user
Delete Branch "enhancement/pass-element-triggered"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #62.
With this PR, you can access the element that triggered the
pjax:sendevent withevent.triggerElement.Fair warning if you end up here - be careful listening to pjax events with Jquery "on". It appears to overwrite the custom pjax event and leaves triggerElement undefined. Probably should be pretty obvious but it took me a while to figure out.
$(document).on("pjax:send", function(e) { console.log(e.triggerElement) // undefined })Is this worth mentioning in the docs?