-
Notifications
You must be signed in to change notification settings - Fork 209
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
Custom View #1
Comments
Thank you so much for being interested in this package. I left out some options to configure the js sweet alert function. I think those options are more related to be set from the frontend part, like the color of the button and such. The current options the package puts into the session are these:
If you want to change the color of the confirm button, you can by:
As you can see, the only property value that is not coming from the package is confirmButtonColor.
I think that part of the color belongs to the frontend, otherwise i think it will be coupled and when you need to change a color you'll have to edit your controller. Ok, but, what if i want a different color for my button based on the type of alert? In that case you can do a check for the type:
This way you can have a different button colors for the type of alert or other custom check you want to do. If you need different kinds of alerts with colors, you can create a partial for each one and include them in the main sweet alert template:
This way you can have any customizable alerts. Hope this helps you!. I would like to know what you think about it! Thank you so much again. |
Awesome! Smart! Nothing more, your answer and what you provided as code sample is just awesome! I'll try to submit a PR tomorow for the documentation to include some details I think could be useful. Thank you :) |
Hi,
First let me say congratulation for that package! Well done!!
I published the vendor view and I try to simply override the
confirmButtonColor
option.So by default your view is as following:
I tried several time but...
The problem is I loose the context
->persistent()
or->autoclose()
forshowConfirmButton
, it displays the button when it should not because I can't properly set the option...It's like I'm missing a
{!! Session::get('sweet_alert.showConfirmButton') !!}
to dynamically get the boolean :)I'm probably missing something but, could you please be kind and provide me a sample code exemple on how you would simply keep your perfect work but customise the
confirmButtonColor
?Regards,
:)
The text was updated successfully, but these errors were encountered: