/
WStackedWidget.min.js
10 lines (10 loc) · 4.24 KB
/
WStackedWidget.min.js
1
2
3
4
5
6
7
8
9
10
WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"WStackedWidget",function(D,h){function w(c){return c.nodeType==1}jQuery.data(h,"obj",this);var e=D.WT,B=[],x=[];this.wtResize=function(c,a,f,d){function p(k){var j=e.px(k,"marginTop");j+=e.px(k,"marginBottom");if(!e.boxSizing(k)){j+=e.px(k,"borderTopWidth");j+=e.px(k,"borderBottomWidth");j+=e.px(k,"paddingTop");j+=e.px(k,"paddingBottom")}return j}var q=f>=0;c.lh=q&&d;c.style.height=q?f+"px":"";if(e.boxSizing(c)){f-=e.px(c,"marginTop");f-=e.px(c,"marginBottom");
f-=e.px(c,"borderTopWidth");f-=e.px(c,"borderBottomWidth");f-=e.px(c,"paddingTop");f-=e.px(c,"paddingBottom");a-=e.px(c,"marginLeft");a-=e.px(c,"marginRight");a-=e.px(c,"borderLeftWidth");a-=e.px(c,"borderRightWidth");a-=e.px(c,"paddingLeft");a-=e.px(c,"paddingRight")}var m,C,g;m=0;for(C=c.childNodes.length;m<C;++m){g=c.childNodes[m];if(w(g))if(!e.isHidden(g)&&!$(g).hasClass("out"))if(q){var r=f-p(g);if(r>0){if(g.offsetTop>0){var u=e.css(g,"overflow");if(u==="visible"||u==="")g.style.overflow="auto"}if(g.wtResize)g.wtResize(g,
a,r,d);else{r=r+"px";if(g.style.height!=r){g.style.height=r;g.lh=d}}}}else if(g.wtResize)g.wtResize(g,a,-1,d);else{g.style.height="";g.lh=false}}};this.wtGetPs=function(c,a,f,d){return d};this.adjustScroll=function(c){var a,f,d,p=h.scrollLeft,q=h.scrollTop;a=0;for(f=h.childNodes.length;a<f;++a){d=h.childNodes[a];if(w(d))if(d!=c){if(d.style.display!="none"){x[a]=p;B[a]=q}}else if(typeof x[a]!=="undefined"){h.scrollLeft=x[a];h.scrollTop=B[a]}else{h.scrollLeft=0;h.scrollTop=0}}};this.setCurrent=function(c){var a,
f,d;this.adjustScroll(c);a=0;for(f=h.childNodes.length;a<f;++a){d=h.childNodes[a];if(w(d))if(d!=c){if(d.style.display!="none")d.style.display="none"}else{d.style.display="";if(h.lh){h.lh=false;h.style.height=""}}}}});
WT_DECLARE_WT_MEMBER(2,JavaScriptPrototype,"WStackedWidget.prototype.animateChild",function(D,h,w,e,B,x){var c=function(a,f,d,p,q,m){function C(){var v,H=i.childNodes.length,E=-1,F=-1;for(v=0;v<H&&(E==-1||F==-1);++v){var G=i.childNodes[v];if(G==f)F=v;else if(G.style.display!=="none"&&!$(G).hasClass("out"))E=v}return{from:E,to:F}}function g(){y.removeClass(l+" in");b.style.position="";b.style.left="";b.style.width="";b.style.top="";if(!d||typeof jQuery.data(i.parentNode,"layout")==="undefined")b.style.height=
b.nativeHeight;b.nativeHeight=null;if(a.isGecko&&d&u)b.style.opacity="1";b.style[a.styleAttribute("animation-duration")]="";b.style[a.styleAttribute("animation-timing-function")]=""}function r(){z.removeClass(l+" out");s.style.display="none";s.style[a.styleAttribute("animation-duration")]="";s.style[a.styleAttribute("animation-timing-function")]=""}var u=256,k=["ease","linear","ease-in","ease-out","ease-in-out"],j=a.vendorPrefix(a.styleAttribute("animation-duration"))=="Webkit"?"webkitAnimationEnd":
"animationend";if(m.display!=="none"){var i=f.parentNode,A=i.wtAutoReverse,t=C();if(!(t.from==-1||t.to==-1||t.from==t.to)){var s=i.childNodes[t.from],b=i.childNodes[t.to],z=$(s),y=$(b),n=i.scrollHeight,o=i.scrollWidth;b.nativeHeight=b.style.height;if(z.hasClass("in"))z.one(j,function(){c(a,f,d,p,1,m)});else if(y.hasClass("out"))y.one(j,function(){c(a,f,d,p,1,m)});else{n-=a.px(i,"paddingTop");n-=a.px(i,"paddingBottom");n-=a.px(b,"marginTop");n-=a.px(b,"marginBottom");n-=a.px(b,"borderTopWidth");n-=
a.px(b,"borderBottomWidth");n-=a.px(b,"paddingTop");n-=a.px(b,"paddingBottom");o-=a.px(i,"paddingLeft");o-=a.px(i,"paddingRight");o-=a.px(b,"marginLeft");o-=a.px(b,"marginRight");o-=a.px(b,"borderLeftWidth");o-=a.px(b,"borderRightWidth");o-=a.px(b,"paddingLeft");o-=a.px(b,"paddingRight");b.style.left=s.style.left||a.px(i,"paddingLeft");b.style.top=s.style.top||a.px(i,"paddingTop");b.style.width=o+"px";b.style.height=n+"px";b.style.position="absolute";if(a.isGecko&&d&u)b.style.opacity="0";b.style.display=
m.display;A=A&&t.to<t.from;var l="";switch(d&255){case 1:A=!A;case 2:l="slide";break;case 3:l="slideup";break;case 4:l="slidedown";break;case 5:l="pop";break}if(d&u)l+=" fade";if(A)l+=" reverse";s.style[a.styleAttribute("animation-duration")]=q+"ms";b.style[a.styleAttribute("animation-duration")]=q+"ms";s.style[a.styleAttribute("animation-timing-function")]=k[[0,1,3,2,4,5][p]];b.style[a.styleAttribute("animation-timing-function")]=k[p];z.addClass(l+" out");z.one(j,r);y.addClass(l+" in");y.one(j,g)}}}};
c(D,h,w,e,B,x)});