diff options
author | Christoph Cullmann <cullmann@kde.org> | 2024-04-28 17:33:09 +0200 |
---|---|---|
committer | Christoph Cullmann <cullmann@kde.org> | 2024-04-28 17:33:09 +0200 |
commit | e77051ccc4b47951bfa4fde2be436b1bb2fb113b (patch) | |
tree | f0b75ee3521da9c8cd39dac4359212348f70e4e8 /themes/blowfish/assets/js/shortcodes | |
parent | 4b355837824ac2422d371acef790f0f4249255c7 (diff) |
use https://github.com/nunocoracao/blowfish.git
Diffstat (limited to 'themes/blowfish/assets/js/shortcodes')
-rw-r--r-- | themes/blowfish/assets/js/shortcodes/gallery.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/themes/blowfish/assets/js/shortcodes/gallery.js b/themes/blowfish/assets/js/shortcodes/gallery.js new file mode 100644 index 0000000..0c6ac39 --- /dev/null +++ b/themes/blowfish/assets/js/shortcodes/gallery.js @@ -0,0 +1,22 @@ +function _getDefaultPackeryOptions() { + return { + percentPosition: true, + gutter: 5, + resize: true + }; +} + +(function init() { + + $(window).on("load", function () { + let packeries = []; + let nodeGalleries = document.querySelectorAll('.gallery'); + + nodeGalleries.forEach(nodeGallery => { + // TODO : implement a reader of Packery configuration _getPackeryOptions; for example by reading data-attribute + let packery = new Packery(nodeGallery, _getDefaultPackeryOptions()); + packeries.push(packery); + }); + console.groupEnd(); + }); +})();
\ No newline at end of file |