Added baguette.js to display a lightbox for images and galleries
[danixland-site-plugin.git] / baguette / baguetteLoad.js
diff --git a/baguette/baguetteLoad.js b/baguette/baguetteLoad.js
new file mode 100644 (file)
index 0000000..a7178eb
--- /dev/null
@@ -0,0 +1,10 @@
+window.addEventListener("load", function() {
+       var options = {
+               captions : function(t) {
+                       var e=t.parentElement.getElementsByTagName("figcaption")[0];
+                       return!!e&&e.textContent
+               }
+       };
+       baguetteBox.run( ".wp-block-gallery", options);
+       baguetteBox.run( ".wp-block-image", options);
+});
\ No newline at end of file