nicolas-t/Chocolat

Option to hide buttons

johansmitsnl opened this issue · 4 comments

Add a option to hide buttons.
For example when on mobile and (swipe enabled) you don't want to show the left/right buttons.

Suggestion would be to hide buttons like:

{
  hideButtons: ['left', 'right', 'close', 'all', ...] // default empty (show all buttons)
}

Hello,

Why don't you use css for this ?

It is simpler to pass a check if you are mobile to a script function then inject extra css. If you have a suggestion please let me know

I'd say the point is the plugin advertises itself as 'full-fledged' so to say, not a diy set, and so the expectation for me was to be able to fully control it from its boot function. Having custom css is a bit less maintainable imo.

You can use the afterMarkup hook to remove elements you don't want:
https://chocolat.gitbook.io/chocolat/options#aftermarkup