Team:Valencia UPV/Core:JS/gwdpage min.js

From 2014.igem.org

(function(){"use strict";var b=function(a){setTimeout(a,0)};var d=function(a,e){var c;c=document.createEvent("Event");c.initEvent(a,!0,!0);e.dispatchEvent(c)};document.register&&document.registerElement("gwd-page",{prototype:Object.create(HTMLDivElement.prototype,{createdCallback:{value:function(){this.c=this.handleReadyEvent_.bind(this);this.a=[];this.b=!1;var a=parseInt(this.getAttribute("data-gwd-width"),10)||this.clientWidth;this.d=(parseInt(this.getAttribute("data-gwd-height"),10)||this.clientHeight)>=a},enumerable:!0},attachedCallback:{value:function(){this.addEventListener("ready",this.c,!1);b(function(){this.a=Array.prototype.slice.call(this.querySelectorAll("*")).filter(function(a){return"function"!= typeof a.gwdLoad||"function"!=typeof a.gwdIsLoaded||a.gwdIsLoaded()?!1:!0},this);0<this.a.length?(this.style.visibility="hidden",this.b=!1):this.firePageReadyEvent_();d("attached",this)}.bind(this))},enumerable:!0},detachedCallback:{value:function(){this.removeEventListener("ready",this.c,!1);this.classList.remove("gwd-play-animation");d("detached",this)},enumerable:!0},gwdIsLoaded:{value:function(){return 0==this.a.length},enumerable:!0},gwdLoad:{value:function(){if(this.gwdIsLoaded())this.firePageReadyEvent_(); else for(var a=this.a.length-1;0<=a;a--)this.a[a].gwdLoad()},enumerable:!0},handleReadyEvent_:{value:function(a){a=this.a.indexOf(a.target);0<=a&&(this.a.splice(a,1),0==this.a.length&&this.firePageReadyEvent_())},enumerable:!1},firePageReadyEvent_:{value:function(){this.style.visibility="";this.b||(d("ready",this),d("pageload",this));this.b=!0},enumerable:!1},gwdPresent:{value:function(){d("pagepresenting",this);this.classList.add("gwd-play-animation")},enumerable:!0},isPortrait:{value:function(){return this.d}}}), "extends":"div"});})()