Sha256: c1d57d1ad50c4639ecd398deb6c1db998e272cc6faf1314dec77ca509ca49153
Contents?: true
Size: 1.27 KB
Versions: 57
Compression:
Stored size: 1.27 KB
Contents
/*! UIkit 2.10.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ !function(a){var b;jQuery&&jQuery.UIkit&&(b=a(jQuery,jQuery.UIkit)),"function"==typeof define&&define.amd&&define("uikit-cover",["uikit"],function(){return b||a(jQuery,jQuery.UIkit)})}(function(a,b){"use strict";b.component("cover",{defaults:{automute:!0},init:function(){if(this.parent=this.element.parent(),this.dimension={w:this.element.width(),h:this.element.height()},this.ratio=this.dimension.w/this.dimension.h,b.$win.on("load resize orientationchange",b.Utils.debounce(function(){this.check()}.bind(this),100)),this.check(),this.element.data("cover",this),this.element.is("iframe")&&this.options.automute){var a=this.element.attr("src");this.element.attr("src","").on("load",function(){this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}',"*")}).attr("src",[a,a.indexOf("?")>-1?"&":"?","enablejsapi=1&api=1"].join(""))}},check:function(){var a,b,c=this.parent.width(),d=this.parent.height();c/this.ratio<d?(a=Math.ceil(d*this.ratio),b=d):(a=c,b=Math.ceil(c/this.ratio)),this.element.css({width:a,height:b})}}),b.ready(function(c){a("[data-uk-cover]",c).each(function(){var c=a(this);if(!c.data("cover")){b.cover(c,b.Utils.options(c.attr("data-uk-cover")))}})})});
Version data entries
57 entries across 57 versions & 1 rubygems