GregPeden / click-confirm

Convenient and elegant inline user confirmation of UI events.
https://sirlamer.github.io/click-confirm/
MIT License
27 stars 13 forks source link

Allow for custom button classes to be provided #6

Closed MorpheusXAUT closed 7 years ago

MorpheusXAUT commented 7 years ago

This PR adds the possibility to provide custom CSS classes to further style the buttons displayed in the confirmation popover. The main use-case for this would probably be changing the color/variation of the button (e.g. using btn-success for 'Yes' and btn-danger for 'No'), however additional styling can also be done.

The PR introduces the properties button-no-class and button-yes-class, defaults are set to the current standards (btn btn-secondary and btn btn-primary respectively). The provided classes are merged with the button-size classes.

Documentation as well as a short example have been added.

I've also fixed the button-icon example code snippets since they were using an incorrect property (missing the button-).

GregPeden commented 7 years ago

Good suggestion, thanks!

I actually want to drop the prefix "button" from the properties but otherwise it looks good.

As you noticed and corrected, the documentation didn't match some of the prop names. I will be editing them to drop the prefix "button" on everything except "buttonSize" immediately and before the next release.