nicolas-t / Chocolat

Chocolat : the lightbox so cool horses use it :horse:
http://chocolat.insipi.de
GNU General Public License v3.0
1.69k stars 170 forks source link

Version 1 : Rollup && Babel && !jQuery #96

Closed nicolas-t closed 4 years ago

nicolas-t commented 5 years ago

Use rollup and babel to generate module. The objective is to get rid of jquery in the middle term.

todo:

:warning: New documentation is here : https://chocolat.gitbook.io/chocolat/

nicolas-t commented 5 years ago

New usage :


// old
$('#example1').Chocolat({});

// new
Chocolat(document.querySelectorAll('#example1 .chocolat-image'), {});

imageSelector option has now been removed

nicolas-t commented 5 years ago

setTitle is a function returning a string (the title of the set) pagination is a function returning a string (the pagination) description is a function returning a string (the description)

removed separator2 settings

renamed : firstImage => firstImageIndex lastImage => lastImageIndex currentImage => currentImageIndex

container must be an element (no string nor jquery objects)

enableZoom => allowZoom fullScreen => allowFullScreen

api() => api

api.place => api.position

settings.images should now be passed as first argument :
Chocolat([{ src }, { src }, ..], {options})