8 lines
3.0 KiB
JavaScript
8 lines
3.0 KiB
JavaScript
//>>built
|
|
define("dojo/window","./_base/lang ./sniff ./_base/window ./dom ./dom-geometry ./dom-style ./dom-construct".split(" "),function(G,g,t,H,n,C,p){g.add("rtl-adjust-position-for-verticalScrollBar",function(b,d){b=t.body(d);d=p.create("div",{style:{overflow:"scroll",overflowX:"visible",direction:"rtl",visibility:"hidden",position:"absolute",left:"0",top:"0",width:"64px",height:"64px"}},b,"last");var e=p.create("div",{style:{overflow:"hidden",direction:"ltr"}},d,"last"),f=0!=n.position(e).x;d.removeChild(e);
|
|
b.removeChild(d);return f});g.add("position-fixed-support",function(b,d){b=t.body(d);d=p.create("span",{style:{visibility:"hidden",position:"fixed",left:"1px",top:"1px"}},b,"last");var e=p.create("span",{style:{position:"fixed",left:"0",top:"0"}},d,"last"),f=n.position(e).x!=n.position(d).x;d.removeChild(e);b.removeChild(d);return f});var l={getBox:function(b){b=b||t.doc;var d="BackCompat"==b.compatMode?t.body(b):b.documentElement,e=n.docScroll(b);if(g("touch")){var f=l.get(b);b=f.innerWidth||d.clientWidth;
|
|
d=f.innerHeight||d.clientHeight}else b=d.clientWidth,d=d.clientHeight;return{l:e.x,t:e.y,w:b,h:d}},get:function(b){if(9>g("ie")&&l!==document.parentWindow){b.parentWindow.execScript("document._parentWindow \x3d window;","Javascript");var d=b._parentWindow;b._parentWindow=null;return d}return b.parentWindow||b.defaultView},scrollIntoView:function(b,d){try{b=H.byId(b);var e=b.ownerDocument||t.doc,f=t.body(e),q=e.documentElement||f.parentNode,h=g("ie"),p=g("webkit");if(b!=f&&b!=q)if(!(g("mozilla")||
|
|
h||p||g("opera"))&&"scrollIntoView"in b)b.scrollIntoView(!1);else{var l="BackCompat"==e.compatMode,z=Math.min(f.clientWidth||q.clientWidth,q.clientWidth||f.clientWidth),A=Math.min(f.clientHeight||q.clientHeight,q.clientHeight||f.clientHeight),e=p||l?f:q,m=d||n.position(b),c=b.parentNode;d=function(a){return 6>=h||7==h&&l?!1:g("position-fixed-support")&&"fixed"==C.get(a,"position").toLowerCase()};if(!d(b))for(;c;){c==f&&(c=e);var a=n.position(c),D=d(c),B="rtl"==C.getComputedStyle(c).direction.toLowerCase();
|
|
if(c==e){a.w=z;a.h=A;e==q&&h&&B&&(a.x+=e.offsetWidth-a.w);if(0>a.x||!h||9<=h)a.x=0;if(0>a.y||!h||9<=h)a.y=0}else{var u=n.getPadBorderExtents(c);a.w-=u.w;a.h-=u.h;a.x+=u.l;a.y+=u.t;var r=c.clientWidth,v=a.w-r;0<r&&0<v&&(B&&g("rtl-adjust-position-for-verticalScrollBar")&&(a.x+=v),a.w=r);r=c.clientHeight;v=a.h-r;0<r&&0<v&&(a.h=r)}D&&(0>a.y&&(a.h+=a.y,a.y=0),0>a.x&&(a.w+=a.x,a.x=0),a.y+a.h>A&&(a.h=A-a.y),a.x+a.w>z&&(a.w=z-a.x));var w=m.x-a.x,x=m.y-a.y,E=w+m.w-a.w,F=x+m.h-a.h,k,y;0<E*w&&(c.scrollLeft||
|
|
c==e||c.scrollWidth>c.offsetHeight)&&(k=Math[0>w?"max":"min"](w,E),B&&(8==h&&!l||9<=h)&&(k=-k),y=c.scrollLeft,c.scrollLeft+=k,k=c.scrollLeft-y,m.x-=k);0<F*x&&(c.scrollTop||c==e||c.scrollHeight>c.offsetHeight)&&(k=Math.ceil(Math[0>x?"max":"min"](x,F)),y=c.scrollTop,c.scrollTop+=k,k=c.scrollTop-y,m.y-=k);c=c!=e&&!D&&c.parentNode}}}catch(I){console.error("scrollIntoView: "+I),b.scrollIntoView(!1)}}};G.setObject("dojo.window",l);return l});
|
|
//# sourceMappingURL=window.js.map
|