-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.min.js
6 lines (6 loc) · 2.78 KB
/
layout.min.js
1
2
3
4
5
6
(function(e){function D(a,b,c){for(var g=0,f=c.length;g<f;g++)c[g].disabled||e.isFunction(c[g][a])&&c[g][a].call(c[g],b)}function y(a,b){D("preLayout",a,b);for(var c=0,g=b.length;c<g;c++)if(!b[c].disabled){var f=b[c].layout.children;f&&f.length&&y(a,f)}D("postLayout",a,b)}function K(a,b){d.initialized=!0;D("updateLayout",a,b);for(var c=0,g=b.length;c<g;c++)if(!b[c].disabled){var f=b[c].layout.children;f&&f.length&&K(a,f)}}function d(a,b){a={force:a};b=b?e(b):q;L?r&&(h.css("overflow",r),r=null):(t&&
(h.css("overflow-y",t),t=null),u&&(h.css("overflow-x",u),u=null));var c=n.innerWidth(),g=n.innerHeight();y(a,b);var f=n.innerWidth(),z=n.innerHeight();if(c!=f||g!=z){y(a,b);var E=n.innerWidth(),F=n.innerHeight();if(f!=E||z!=F)c=function(){if(L){if(A||z!=F||f!=E)r=h.css("overflow"),"hidden"!=r&&h.css("overflow","scroll")}else{if(A||z!=F)u=h.css("overflow-x"),"hidden"!=u&&h.css("overflow-x","scroll");if(A||f!=E)t=h.css("overflow-y"),"hidden"!=t&&h.css("overflow-y","scroll")}},d.initialized&&c(),y(a,
b),d.initialized||c()}K(a,b)}var n=e(window),h=null,G=60,v,q=e(),p=e(),r,u,t,k=navigator.userAgent.toLowerCase(),w=/(chrome)[ \/]([\w.]+)/.exec(k)||/(webkit)[ \/]([\w.]+)/.exec(k)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(k)||/(msie) ([\w.]+)/.exec(k)||0>k.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(k)||[];k=w[1]||"";w=w[2]||"0";for(var H="msie"==!k||8!=parseInt(w,10),A="mozilla"==k,L=A,B=window.requestAnimationFrame,l=window.cancelAnimationFrame||window.cancelRequestAnimationFrame,
C=["ms","moz","webkit","o"],x=0;x<C.length&&!B;++x)B=window[C[x]+"RequestAnimationFrame"],l=window[C[x]+"CancelAnimationFrame"]||window[C[x]+"CancelRequestAnimationFrame"];if(B)var m=function(a){return B(a)};m||(m=window.setTimeout);l||(l=window.clearTimeout);var N=m,O=l;d.ua={browser:k,version:w};d.config=function(a,b){switch(a){case "fps":G=b;break;case "vsync":H=b;break;case "default":m=N;l=O;break;case "fallback":m=window.setTimeout,l=window.clearTimeout}I=H?function(){d()}:M};d.schedule=function(a,
b){if(b||!v)v&&l(v),v=m(function(){d();v=null},a||0)};d.defer=function(a,b){"undefined"==typeof b&&(b=1E3/G);return m(a,b)};d.undefer=function(a){return l(a)};d.add=function(a){h||(h=e("BODY:first"));a.layout=e.extend({children:[]},a.layout);a.layout&&a.layout.parent?(a.layout.parent.layout.children||(a.layout.parent.layout.children=[]),a.layout.parent.layout.children.push(a)):q=q.add(e(a));e.isFunction(a.startLayout)&&a.startLayout.call(a);a=e(a);0==p.length&&0<a.length&&e(window).bind("resize",
I);p=p.add(a)};d.del=function(a){e.isFunction(a.stopLayout)&&a.stopLayout.call(a);a=e(a);p=p.not(a);q=q.not(a);0==p.length&&e(window).unbind("resize",I)};var J=!1,M=function(){if(J)return!1;J=m(function(){d();J=!1},1E3/G)},I=H?function(){d()}:M;"undefined"==typeof OCBNET&&(window.OCBNET={});OCBNET.Layout=d})(jQuery);