Releases: nicolas-t/Chocolat
1.0.0-beta.1
We are getting closer to the jquery-free release.
Documentation here :
https://chocolat.gitbook.io/chocolat
Upgrade guide here :
https://chocolat.gitbook.io/chocolat/upgrading-from-v0.4
1.0.0-beta.0
Pre-release of Chocolat v1.0.0-beta.0
What's new
Dependencies
Chocolat is not relying on jQuery anymore
Build
Modern build generating :
- iife module is meant to be imported via script tags.
<script src="dist/js/chocolat.iife.js"></script>
- esm module is meant to be imported via import thank to bundlers like webpack.
import Chocolat from 'chocolat'
css import stays the same.
Breaking changes
Instanciation
// old
$('#example1').Chocolat({});
// new
Chocolat(document.querySelectorAll('#example1 .chocolat-image'), {});
imageSelector
option has now been removed
Options
imageSelector
has been removed
separator2
has been removed
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)
0.4.21
0.4.20
0.4.19
0.4.18
0.4.17
0.4.16
0.4.15
New hooks :
Added a new hooks :
afterInitialize
called after chocolat is initializedafterImageLoad
called each time an image is loaded (see #47)
$('#example').Chocolat({
afterInitialize : function () {
// your code here
},
afterImageLoad : function () {
// your code here
}
});
Fixed missing var
declarations :
Missing var
declarations made minifying and concatenating failing on some setups.
Thanks to @nicolasbinet (see #52)
Related issue : #49
0.4.14
afterMarkup:
Added a new setting afterMarkup
used to manipulate the layout just after it's created.
This will move the caption to the top of the image for example
$('#example').Chocolat({
afterMarkup: function () {
this.elems.description.appendTo(this.elems.top)
}
});
imageSource:
Added the setting imageSource
. It specifies which attribute contains the image source.
So you can use chocolat on other tags like a div
tag (doesn't support the href
attribute) too.
Thanks to @Airfighter76 see #41