Chocolat : the lightbox so cool horses use it :horse:
Pre-release of Chocolat v1.0.0-beta.0
Chocolat is not relying on jQuery anymore
Modern build generating :
<script src="dist/js/chocolat.iife.js"></script>
import Chocolat from 'chocolat'
css import stays the same.
// old
$('#example1').Chocolat({});
// new
Chocolat(document.querySelectorAll('#example1 .chocolat-image'), {});
imageSelector
option has now been removed
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)
Can be imported as a module :
import $ from 'jquery'
import Chocolat from 'chocolat'
$.fn.Chocolat = Chocolat
Also removed coffeescript, and added prettier.
use jquery 3
Fix #70 & fix #73 (small js error) Fix #72 (Closing fullscreen on IE11 thanks @SilatPerisaiDiri )
Transition when opening for the first time: Fix for issue #59 (Thanks to @willpaige)
One wrapper per instance : Fix for issue #58 (Thanks to @willpaige)
Updated jquery dependency : Use latest version of jquery 1 : see https://github.com/nicolas-t/Chocolat/issues/57
New hooks : Added a new hooks :
afterInitialize
called after chocolat is initializedafterImageLoad
called each time an image is loaded (see https://github.com/nicolas-t/Chocolat/issues/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 https://github.com/nicolas-t/Chocolat/pull/52)
Related issue : https://github.com/nicolas-t/Chocolat/issues/49
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 https://github.com/nicolas-t/Chocolat/pull/41
Can now disable zoom thanks to @benbyford (see https://github.com/nicolas-t/Chocolat/pull/31) Removed unused css thanks to @ptrckvzn (see https://github.com/nicolas-t/Chocolat/pull/33)