5 lines
1.5 KiB
JavaScript
5 lines
1.5 KiB
JavaScript
//>>built
|
|
define("dojo/robot","./_base/array ./dom ./dom-geometry ./_base/kernel ./_base/lang ./_base/window doh/_browserRunner doh/robot ./window".split(" "),function(m,n,h,p,q,r,t,d,l){p.experimental("dojo.robot");q.mixin(d,{_resolveNode:function(b){"function"==typeof b&&(b=b());return b?n.byId(b):null},_scrollIntoView:function(b){var a=null;m.forEach(d._getWindowChain(b),function(d){var e=h.position(b,!1),f=h.getPadBorderExtents(b),c=null;a?(c=a,a={x:a.x+e.x+f.l,y:a.y+e.y+f.t,w:a.w,h:a.h}):a=e;l.scrollIntoView(b,
|
|
a);e=h.position(b,!1);a=c?{x:c.x+e.x+f.l,y:c.y+e.y+f.t,w:a.w,h:a.h}:e;b=d.frameElement})},_position:function(b){var a=null,g=Math.max,e=Math.min;m.forEach(d._getWindowChain(b),function(d){var c=h.position(b,!1),k=h.getPadBorderExtents(b);if(a){var f=l.getBox(b.contentWindow.document);c.r=c.x+f.w;c.b=c.y+f.h;a={x:g(a.x+c.x,c.x)+k.l,y:g(a.y+c.y,c.y)+k.t,r:e(a.x+c.x+a.w,c.r)+k.l,b:e(a.y+c.y+a.h,c.b)+k.t};a.w=a.r-a.x;a.h=a.b-a.y}else a=c;b=d.frameElement});return a},_getWindowChain:function(b){b=l.get(b.ownerDocument);
|
|
var a=[b],g=b.frameElement;return b!=r.global&&g?a.concat(d._getWindowChain(g)):a},scrollIntoView:function(b,a){d.sequence(function(){d._scrollIntoView(d._resolveNode(b))},a)},mouseMoveAt:function(b,a,g,e,f){d._assertRobot();var c={};this.sequence(function(){b=d._resolveNode(b);d._scrollIntoView(b);var a=d._position(b);void 0===f&&(e=a.w/2,f=a.h/2);c.x=a.x+e;c.y=a.y+f},a);this.mouseMoveTo(c,0,g,!1)}});return d});
|
|
//# sourceMappingURL=robot.js.map
|