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

Make confirm dialog overridable in rails_ujs #32402

Closed
mathieumahe opened this issue Apr 1, 2018 · 3 comments
Closed

Make confirm dialog overridable in rails_ujs #32402

mathieumahe opened this issue Apr 1, 2018 · 3 comments

Comments

@mathieumahe
Copy link
Contributor

I would like to override the default confirm dialog in rails_ujs to add different possibilities (a nice modal instead of the default box, add a prompt before destroying super-sensitive data like github does with repos, etc.)

One possibility would be to reference the method as Rails.handleConfirm instead of using a variable here :

delegate document, Rails.buttonClickSelector, 'click', handleConfirm

Like that, we could override it between the import and the call to Rails.start()

Even better, if we could extract the code of the confirm call

in a method accessible from outside the scope of the file, we could be able to redefine only the code we need.

What do you think ?

Thanks !

@y-yagi
Copy link
Member

y-yagi commented Apr 1, 2018

This is being addressed with #29965. Please wait for it to be merged. Thanks.

@y-yagi y-yagi closed this as completed Apr 1, 2018
@mathieumahe
Copy link
Contributor Author

The pull request doesn't look very active.

Should I create a new one following Rafael's advices ?

@y-yagi
Copy link
Member

y-yagi commented Apr 1, 2018

Go ahead 👍

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

No branches or pull requests

2 participants