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

[Question] Return different confirms from one page #15

Open
ghost opened this issue Dec 28, 2015 · 1 comment
Open

[Question] Return different confirms from one page #15

ghost opened this issue Dec 28, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 28, 2015

Before I start complaining (well, not really): very nice work on this plugin/package. A great replacement for the default JS confirm dialog.
There's something I can't figure out though.

On a page to edit a record (in Laravel 5), I have two options:

  • delete an image
  • redirect to another page

The first option should launch a confirm-with-reveal stating something like: "Are you sure you want to delete this record? This action cannot be undone."
The second option should launch a confirm-with-reveal stating: "You are about to leave this page. Have you saved you changes?"

Usually, I add a section to the page called @section('revealoptions') which contains a title and body option, extending the rest of the options from another page. However, since I have two options triggered a confirm-with-reveal, I can't use this or it will show the same text for both links.
Adding data-confirm="Text here" doesn't work because that will show the default JS confirm.

Am I missing something?

@ghost
Copy link
Author

ghost commented Dec 28, 2015

I think I found a solution by adding a div with the right content in the blade, and triggering it on the anchor of the first option.
Not exactly what I had in mind, because I wanted to prevent using extra HTML, so if you have another suggestion: please share

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

0 participants