Version 1
[yaffs-website] / web / modules / contrib / blazy / js / blazy.colorbox.min.js
diff --git a/web/modules/contrib/blazy/js/blazy.colorbox.min.js b/web/modules/contrib/blazy/js/blazy.colorbox.min.js
new file mode 100644 (file)
index 0000000..c150d01
--- /dev/null
@@ -0,0 +1 @@
+!function(a,b,c,d){"use strict";function g(b,g){function l(){f.removeClass(function(a,b){return(b.match(/(^|\s)colorbox-\S+/g)||[]).join(" ")})}function m(){d.clearTimeout(e);var b={width:i.width||c.colorbox.maxWidth,height:i.height||c.colorbox.maxHeight};e=d.setTimeout(function(){if(a("#cboxOverlay").is(":visible")){var c=a("#cboxLoadedContent"),d=a(".cboxIframe",c);d.length?(c.addClass("media media--ratio"),d.attr("width",b.width).attr("height",b.height).addClass("media__element"),c.css({paddingBottom:b.height/b.width*100+"%",height:0}),a.colorbox.resize({innerWidth:b.width,innerHeight:b.height})):(c.removeClass("media media--ratio"),c.css({paddingBottom:"",height:b.height}).removeClass("media__element"))}},10)}var h=a(g),i=h.data("media")||{},j="image"!==i.type,k={rel:i.rel||null,iframe:j,title:function(){var a=h.next(".litebox-caption");return a.length?a.html():""},onComplete:function(){l(),f.addClass("colorbox-on colorbox-on--"+i.type),j&&(m(),f.addClass("colorbox-on--media"))},onClosed:function(){l()}};h.colorbox(a.extend({},c.colorbox,k))}var e,f=a("body");b.behaviors.blazyColorbox={attach:function(b){if(c.colorbox.mobiledetect&&d.matchMedia){var e=d.matchMedia("(max-device-width: "+c.colorbox.mobiledevicewidth+")");if(e.matches)return}a("[data-colorbox-trigger]",b).once("blazy-colorbox").each(g)}}}(jQuery,Drupal,drupalSettings,this);