-
Notifications
You must be signed in to change notification settings - Fork 0
/
gwdpage_min.js
6 lines (6 loc) · 2.54 KB
/
gwdpage_min.js
1
2
3
4
5
6
(function(){'use strict';var c;var d=function(a,f){var b=document.createEvent("Event");b.initEvent(a,!0,!0);f.dispatchEvent(b)};var e=function(){};goog.inherits(e,HTMLDivElement);c=e.prototype;c.createdCallback=function(){this.h=this.i.bind(this);this.a=[];this.g=this.b=this.f=!1;var a=parseInt(this.getAttribute("data-gwd-width"),10)||this.clientWidth;this.j=(parseInt(this.getAttribute("data-gwd-height"),10)||this.clientHeight)>=a;this.c=!1};
c.attachedCallback=function(){this.addEventListener("ready",this.h,!1);setTimeout(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);this.g=!0;0<this.a.length?(this.style.visibility="hidden",this.f=!1):g(this);this.b=!0;d("attached",this)}.bind(this),0)};
c.detachedCallback=function(){this.removeEventListener("ready",this.h,!1);this.classList.remove("gwd-play-animation");d("detached",this)};c.gwdActivate=function(){this.classList.remove("gwd-inactive");Array.prototype.slice.call(this.querySelectorAll("*")).forEach(function(a){"function"==typeof a.gwdActivate&&"function"==typeof a.gwdIsActive&&0==a.gwdIsActive()&&a.gwdActivate()});this.c=!0;this.b?this.b=!1:d("attached",this);d("pageactivated",this)};
c.gwdDeactivate=function(){this.classList.add("gwd-inactive");this.classList.remove("gwd-play-animation");var a=Array.prototype.slice.call(this.querySelectorAll("*"));a.push(this);for(var f=0;f<a.length;f++){var b=a[f];b.classList.remove("gwd-pause-animation");if(b.hasAttribute("data-gwd-current-label")){var h=b.getAttribute("data-gwd-current-label");b.classList.remove(h);b.removeAttribute("data-gwd-current-label")}delete b.gwdGotoCounters;b!=this&&"function"==typeof b.gwdDeactivate&&"function"==
typeof b.gwdIsActive&&1==b.gwdIsActive()&&b.gwdDeactivate()}this.c=!1;d("pagedeactivated",this);d("detached",this)};c.gwdIsActive=function(){return this.c};c.gwdIsLoaded=function(){return this.g&&0==this.a.length};c.gwdLoad=function(){if(this.gwdIsLoaded())g(this);else for(var a=this.a.length-1;0<=a;a--)this.a[a].gwdLoad()};c.i=function(a){a=this.a.indexOf(a.target);0<=a&&(this.a.splice(a,1),0==this.a.length&&g(this))};
var g=function(a){a.style.visibility="";a.f||(d("ready",a),d("pageload",a));a.f=!0};e.prototype.gwdPresent=function(){d("pagepresenting",this);this.classList.add("gwd-play-animation")};e.prototype.isPortrait=function(){return this.j};e.prototype.attributeChangedCallback=function(){};document.registerElement("gwd-page",{prototype:e.prototype,"extends":"div"});}).call(this);