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

Moves event delegation to namespaced object #413

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stevenwanderski
Copy link

Moving event handlers to a public namespace allows the handlers to be overriden by plugins.

// See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching
$(window).on("pageshow.rails", function () {
$.rails.handlers = {
pageshow: function(){
Copy link
Member

Choose a reason for hiding this comment

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

space after the )

},

ajaxCompleteForm: function(e, ctx) {
if (ctx == e.target) rails.enableFormElements($(ctx));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we didn't had this if guard before - what's the rationale behind it?

Copy link
Author

Choose a reason for hiding this comment

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

I wasn't sure about the logic behind this conditional, but instead of ripping it out I left it in. I'm assuming it has a reason for being there.

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

Successfully merging this pull request may close these issues.

3 participants