Skip to content
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

Add pjax:clicked event #345

Merged
merged 2 commits into from Jan 29, 2014
Merged

Add pjax:clicked event #345

merged 2 commits into from Jan 29, 2014

Conversation

josh
Copy link
Contributor

@josh josh commented Jan 29, 2014

Fires after pjax:click and after the pjax request is initiated.

/cc @mislav

Fires after pjax:click and after the pjax request is initiated
@@ -95,6 +95,9 @@ function handleClick(event, container, options) {
if (!clickEvent.isDefaultPrevented()) {
pjax(opts)
event.preventDefault()

clickEvent = $.Event('pjax:clicked')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this leak a global. You can pass 'pjax:clicked' string directly to trigger

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses an another defined var.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realizing I don't need to make the event, cause I don't care about seeing if its canceled.

clickEvent reference is not used
josh added a commit that referenced this pull request Jan 29, 2014
@josh josh merged commit 867b23a into master Jan 29, 2014
@josh josh deleted the did-click-event branch January 29, 2014 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants