Commit 0b641d1c authored by NickWilde's avatar NickWilde

Issue #2872265 by NickWilde: It need to add a colorbox gallery support

parent e0bcad18
......@@ -52,6 +52,7 @@ Optional extra configuration you can add:
- `data-width` and `data-height` to the anchor to control the size of the
modal window.
- `data-class` to add a class to the colorbox wrapper.
- `data-rel="[galleryid]` to add a next/previous options to the opened colorboxes.
MAINTAINERS
......
......@@ -5,7 +5,7 @@
*/
Drupal.behaviors.colorboxInline = {
attach: function (context, drupalSettings) {
$('[data-colorbox-inline]', context).once().click(function () {
$('[data-colorbox-inline]', context).once('colorbox-inline').each(function () {
var $link = $(this),
data = $link.data(),
settings = $.extend({}, drupalSettings.colorbox, {
......@@ -16,8 +16,11 @@
href: data.colorboxInline,
width: data.width,
height: data.height,
rel: data.rel
});
$link.colorbox(settings);
$link.colorbox.close();
$link.click(function () { $(this).colorbox();});
});
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment