Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 5 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
75 build/dd-drag/dd-drag-coverage.js
42 additions, 33 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
10 build/dd-drag/dd-drag-debug.js
@@ -1203,8 +1203,14 @@ YUI.add('dd-drag', function (Y, NAME) {
_defDragFn: function(e) {
if (this.get('move')) {
if (e.scroll && e.scroll.node) {
- e.scroll.node.set('scrollTop', e.scroll.top);
- e.scroll.node.set('scrollLeft', e.scroll.left);
+ var domNode = e.scroll.node.getDOMNode();
+ //If it's the window
+ if (domNode === Y.config.win) {
+ domNode.scrollTo(e.scroll.left, e.scroll.top);
+ } else {
+ e.scroll.node.set('scrollTop', e.scroll.top);
+ e.scroll.node.set('scrollLeft', e.scroll.left);
+ }
}
this.get(DRAG_NODE).setXY([e.pageX, e.pageY]);
this.realXY = [e.pageX, e.pageY];
View
2 build/dd-drag/dd-drag-min.js
@@ -1 +1 @@
-YUI.add("dd-drag",function(e,t){var n=e.DD.DDM,r="node",i="dragging",s="dragNode",o="offsetHeight",u="offsetWidth",a="drag:mouseDown",f="drag:afterMouseDown",l="drag:removeHandle",c="drag:addHandle",h="drag:removeInvalid",p="drag:addInvalid",d="drag:start",v="drag:end",m="drag:drag",g="drag:align",y=function(t){this._lazyAddAttrs=!1,y.superclass.constructor.apply(this,arguments);var r=n._regDrag(this);r||e.error("Failed to register node, already in use: "+t.node)};y.NAME="drag",y.START_EVENT="mousedown",y.ATTRS={node:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid Node Given: "+t),n}},dragNode:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid dragNode Given: "+t),n}},offsetNode:{value:!0},startCentered:{value:!1},clickPixelThresh:{value:n.get("clickPixelThresh")},clickTimeThresh:{value:n.get("clickTimeThresh")},lock:{value:!1,setter:function(e){return e?this.get(r).addClass(n.CSS_PREFIX+"-locked"):this.get(r).removeClass(n.CSS_PREFIX+"-locked"),e}},data:{value:!1},move:{value:!0},useShim:{value:!0},activeHandle:{value:!1},primaryButtonOnly:{value:!0},dragging:{value:!1},parent:{value:!1},target:{value:!1,setter:function(e){return this._handleTarget(e),e}},dragMode:{value:null,setter:function(e){return n._setDragMode(e)}},groups:{value:["default"],getter:function(){this._groups||(this._groups={});var t=[];return e.each(this._groups,function(e,n){t[t.length]=n}),t},setter:function(t){return this._groups={},e.each(t,function(e){this._groups[e]=!0},this),t}},handles:{value:null,setter:function(t){return t?(this._handles={},e.each(t,function(t){var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;this._handles[n]=t},this)):this._handles=null,t}},bubbles:{setter:function(e){return this.addTarget(e),e}},haltDown:{value:!0}},e.extend(y,e.Base,{_canDrag:function(e){return e&&e.setXY&&e.getXY&&e.test&&e.contains?!0:!1},_bubbleTargets:e.DD.DDM,addToGroup:function(e){return this._groups[e]=!0,n._activateTargets(),this},removeFromGroup:function(e){return delete this._groups[e],n._activateTargets(),this},target:null,_handleTarget:function(t){e.DD.Drop&&(t===!1?this.target&&(n._unregTarget(this.target),this.target=null):(e.Lang.isObject(t)||(t={}),t.bubbleTargets=t.bubbleTargets||e.Object.values(this._yuievt.targets),t.node=this.get(r),t.groups=t.groups||this.get("groups"),this.target=new e.DD.Drop(t)))},_groups:null,_createEvents:function(){this.publish(a,{defaultFn:this._defMouseDownFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(g,{defaultFn:this._defAlignFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(m,{defaultFn:this._defDragFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(v,{defaultFn:this._defEndFn,preventedFn:this._prevEndFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});var t=[f,l,c,h,p,d,"drag:drophit","drag:dropmiss","drag:over","drag:enter","drag:exit"];e.each(t,function(e){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,preventable:!1,queuable:!1,prefix:"drag"})},this)},_ev_md:null,_startTime:null,_endTime:null,_handles:null,_invalids:null,_invalidsDefault:{textarea:!0,input:!0,a:!0,button:!0,select:!0},_dragThreshMet:null,_fromTimeout:null,_clickTimeout:null,deltaXY:null,startXY:null,nodeXY:null,lastXY:null,actXY:null,realXY:null,mouseXY:null,region:null,_handleMouseUp:function(){this.fire("drag:mouseup"),this._fixIEMouseUp(),n.activeDrag&&n._end()},_fixDragStart:function(e){this.validClick(e)&&e.preventDefault()},_ieSelectFix:function(){return!1},_ieSelectBack:null,_fixIEMouseDown:function(){e.UA.ie&&(this._ieSelectBack=e.config.doc.body.onselectstart,e.config.doc.body.onselectstart=this._ieSelectFix)},_fixIEMouseUp:function(){e.UA.ie&&(e.config.doc.body.onselectstart=this._ieSelectBack)},_handleMouseDownEvent:function(e){this.fire(a,{ev:e})},_defMouseDownFn:function(t){var r=t.ev;this._dragThreshMet=!1,this._ev_md=r;if(this.get("primaryButtonOnly")&&r.button>1)return!1;this.validClick(r)&&(this._fixIEMouseDown(r),y.START_EVENT.indexOf("gesture")!==0&&(this.get("haltDown")?r.halt():r.preventDefault()),this._setStartPosition([r.pageX,r.pageY]),n.activeDrag=this,this._clickTimeout=e.later(this.get("clickTimeThresh"),this,this._timeoutCheck)),this.fire(f,{ev:r})},validClick:function(t){var n=!1,i=!1,s=t.target,o=null,u=null,a=null,f=!1;if(this._handles)e.each(this._handles,function(t,r){t instanceof e.Node||t instanceof e.NodeList?n||(a=t,a instanceof e.Node&&(a=new e.NodeList(t._node)),a.each(function(e){e.contains(s)&&(n=!0)})):e.Lang.isString(r)&&s.test(r+", "+r+" *")&&!o&&(o=r,n=!0)});else{i=this.get(r);if(i.contains(s)||i.compareTo(s))n=!0}return n&&this._invalids&&e.each(this._invalids,function(t,r){e.Lang.isString(r)&&s.test(r+", "+r+" *")&&(n=!1)}),n&&(o?(u=t.currentTarget.all(o),f=!1,u.each(function(e){(e.contains(s)||e.compareTo(s))&&!f&&(f=!0,this.set("activeHandle",e))},this)):this.set("activeHandle",this.get(r))),n},_setStartPosition:function(e){this.startXY=e,this.nodeXY=this.lastXY=this.realXY=this.get(r).getXY(),this.get("offsetNode")?this.deltaXY=[this.startXY[0]-this.nodeXY[0],this.startXY[1]-this.nodeXY[1]]:this.deltaXY=[0,0]},_timeoutCheck:function(){!this.get("lock")&&!this._dragThreshMet&&this._ev_md&&(this._fromTimeout=this._dragThreshMet=!0,this.start(),this._alignNode([this._ev_md.pageX,this._ev_md.pageY],!0))},removeHandle:function(t){var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]&&(delete this._handles[n],this.fire(l,{handle:t})),this},addHandle:function(t){this._handles||(this._handles={});var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]=t,this.fire(c,{handle:t}),this},removeInvalid:function(e){return this._invalids[e]&&(this._invalids[e]=null,delete this._invalids[e],this.fire(h,{handle:e})),this},addInvalid:function(t){return e.Lang.isString(t)&&(this._invalids[t]=!0,this.fire(p,{handle:t})),this},initializer:function(){this.get(r).dd=this;if(!this.get(r).get("id")){var t=e.stamp(this.get(r));this.get(r).set("id",t)}this.actXY=[],this._invalids=e.clone(this._invalidsDefault,!0),this._createEvents(),this.get(s)||this.set(s,this.get(r)),this.on("initializedChange",e.bind(this._prep,this)),this.set("groups",this.get("groups"))},_prep:function(){this._dragThreshMet=!1;var t=this.get(r);t.addClass(n.CSS_PREFIX+"-draggable"),t.on(y.START_EVENT,e.bind(this._handleMouseDownEvent,this)),t.on("mouseup",e.bind(this._handleMouseUp,this)),t.on("dragstart",e.bind(this._fixDragStart,this))},_unprep:function(){var e=this.get(r);e.removeClass(n.CSS_PREFIX+"-draggable"),e.detachAll("mouseup"),e.detachAll("dragstart"),e.detachAll(y.START_EVENT),this.mouseXY=[],this.deltaXY=[0,0],this.startXY=[],this.nodeXY=[],this.lastXY=[],this.actXY=[],this.realXY=[]},start:function(){if(!this.get("lock")&&!this.get(i)){var e=this.get(r),t,a,f;this._startTime=(new Date).getTime(),n._start(),e.addClass(n.CSS_PREFIX+"-dragging"),this.fire(d,{pageX:this.nodeXY[0],pageY:this.nodeXY[1],startTime:this._startTime}),e=this.get(s),f=this.nodeXY,t=e.get(u),a=e.get(o),this.get("startCentered")&&this._setStartPosition([f[0]+t/2,f[1]+a/2]),this.region={0:f[0],1:f[1],area:0,top:f[1],right:f[0]+t,bottom:f[1]+a,left:f[0]},this.set(i,!0)}return this},end:function(){return this._endTime=(new Date).getTime(),this._clickTimeout&&this._clickTimeout.cancel(),this._dragThreshMet=this._fromTimeout=!1,!this.get("lock")&&this.get(i)&&this.fire(v,{pageX:this.lastXY[0],pageY:this.lastXY[1],startTime:this._startTime,endTime:this._endTime}),this.get(r).removeClass(n.CSS_PREFIX+"-dragging"),this.set(i,!1),this.deltaXY=[0,0],this},_defEndFn:function(){this._fixIEMouseUp(),this._ev_md=null},_prevEndFn:function(){this._fixIEMouseUp(),this.get(s).setXY(this.nodeXY),this._ev_md=null,this.region=null},_align:function(e){this.fire(g,{pageX:e[0],pageY:e[1]})},_defAlignFn:function(e){this.actXY=[e.pageX-this.deltaXY[0],e.pageY-this.deltaXY[1]]},_alignNode:function(e,t){this._align(e),t||this._moveNode()},_moveNode:function(e){var t=[],n=[],r=this.nodeXY,i=this.actXY;t[0]=i[0]-this.lastXY[0],t[1]=i[1]-this.lastXY[1],n[0]=i[0]-this.nodeXY[0],n[1]=i[1]-this.nodeXY[1],this.region={0:i[0],1:i[1],area:0,top:i[1],right:i[0]+this.get(s).get(u),bottom:i[1]+this.get(s).get(o),left:i[0]},this.fire(m,{pageX:i[0],pageY:i[1],scroll:e,info:{start:r,xy:i,delta:t,offset:n}}),this.lastXY=i},_defDragFn:function(e){this.get("move")&&(e.scroll&&e.scroll.node&&(e.scroll.node.set("scrollTop",e.scroll.top),e.scroll.node.set("scrollLeft",e.scroll.left)),this.get(s).setXY([e.pageX,e.pageY]),this.realXY=[e.pageX,e.pageY])},_move:function(e){if(this.get("lock"))return!1;this.mouseXY=[e.pageX,e.pageY];if(!this._dragThreshMet){var t=Math.abs(this.startXY[0]-e.pageX),n=Math.abs(this.startXY[1]-e.pageY);if(t>this.get("clickPixelThresh")||n>this.get("clickPixelThresh"))this._dragThreshMet=!0,this.start(),e&&e.preventDefault&&e.preventDefault(),this._alignNode([e.pageX,e.pageY])}else this._clickTimeout&&this._clickTimeout.cancel(),this._alignNode([e.pageX,e.pageY])},stopDrag:function(){return this.get(i)&&n._end(),this},destructor:function(){this._unprep(),this.target&&this.target.destroy(),n._unregDrag(this)}}),e.namespace("DD"),e.DD.Drag=y},"@VERSION@",{requires:["dd-ddm-base"]});
+YUI.add("dd-drag",function(e,t){var n=e.DD.DDM,r="node",i="dragging",s="dragNode",o="offsetHeight",u="offsetWidth",a="drag:mouseDown",f="drag:afterMouseDown",l="drag:removeHandle",c="drag:addHandle",h="drag:removeInvalid",p="drag:addInvalid",d="drag:start",v="drag:end",m="drag:drag",g="drag:align",y=function(t){this._lazyAddAttrs=!1,y.superclass.constructor.apply(this,arguments);var r=n._regDrag(this);r||e.error("Failed to register node, already in use: "+t.node)};y.NAME="drag",y.START_EVENT="mousedown",y.ATTRS={node:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid Node Given: "+t),n}},dragNode:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid dragNode Given: "+t),n}},offsetNode:{value:!0},startCentered:{value:!1},clickPixelThresh:{value:n.get("clickPixelThresh")},clickTimeThresh:{value:n.get("clickTimeThresh")},lock:{value:!1,setter:function(e){return e?this.get(r).addClass(n.CSS_PREFIX+"-locked"):this.get(r).removeClass(n.CSS_PREFIX+"-locked"),e}},data:{value:!1},move:{value:!0},useShim:{value:!0},activeHandle:{value:!1},primaryButtonOnly:{value:!0},dragging:{value:!1},parent:{value:!1},target:{value:!1,setter:function(e){return this._handleTarget(e),e}},dragMode:{value:null,setter:function(e){return n._setDragMode(e)}},groups:{value:["default"],getter:function(){this._groups||(this._groups={});var t=[];return e.each(this._groups,function(e,n){t[t.length]=n}),t},setter:function(t){return this._groups={},e.each(t,function(e){this._groups[e]=!0},this),t}},handles:{value:null,setter:function(t){return t?(this._handles={},e.each(t,function(t){var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;this._handles[n]=t},this)):this._handles=null,t}},bubbles:{setter:function(e){return this.addTarget(e),e}},haltDown:{value:!0}},e.extend(y,e.Base,{_canDrag:function(e){return e&&e.setXY&&e.getXY&&e.test&&e.contains?!0:!1},_bubbleTargets:e.DD.DDM,addToGroup:function(e){return this._groups[e]=!0,n._activateTargets(),this},removeFromGroup:function(e){return delete this._groups[e],n._activateTargets(),this},target:null,_handleTarget:function(t){e.DD.Drop&&(t===!1?this.target&&(n._unregTarget(this.target),this.target=null):(e.Lang.isObject(t)||(t={}),t.bubbleTargets=t.bubbleTargets||e.Object.values(this._yuievt.targets),t.node=this.get(r),t.groups=t.groups||this.get("groups"),this.target=new e.DD.Drop(t)))},_groups:null,_createEvents:function(){this.publish(a,{defaultFn:this._defMouseDownFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(g,{defaultFn:this._defAlignFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(m,{defaultFn:this._defDragFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(v,{defaultFn:this._defEndFn,preventedFn:this._prevEndFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});var t=[f,l,c,h,p,d,"drag:drophit","drag:dropmiss","drag:over","drag:enter","drag:exit"];e.each(t,function(e){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,preventable:!1,queuable:!1,prefix:"drag"})},this)},_ev_md:null,_startTime:null,_endTime:null,_handles:null,_invalids:null,_invalidsDefault:{textarea:!0,input:!0,a:!0,button:!0,select:!0},_dragThreshMet:null,_fromTimeout:null,_clickTimeout:null,deltaXY:null,startXY:null,nodeXY:null,lastXY:null,actXY:null,realXY:null,mouseXY:null,region:null,_handleMouseUp:function(){this.fire("drag:mouseup"),this._fixIEMouseUp(),n.activeDrag&&n._end()},_fixDragStart:function(e){this.validClick(e)&&e.preventDefault()},_ieSelectFix:function(){return!1},_ieSelectBack:null,_fixIEMouseDown:function(){e.UA.ie&&(this._ieSelectBack=e.config.doc.body.onselectstart,e.config.doc.body.onselectstart=this._ieSelectFix)},_fixIEMouseUp:function(){e.UA.ie&&(e.config.doc.body.onselectstart=this._ieSelectBack)},_handleMouseDownEvent:function(e){this.fire(a,{ev:e})},_defMouseDownFn:function(t){var r=t.ev;this._dragThreshMet=!1,this._ev_md=r;if(this.get("primaryButtonOnly")&&r.button>1)return!1;this.validClick(r)&&(this._fixIEMouseDown(r),y.START_EVENT.indexOf("gesture")!==0&&(this.get("haltDown")?r.halt():r.preventDefault()),this._setStartPosition([r.pageX,r.pageY]),n.activeDrag=this,this._clickTimeout=e.later(this.get("clickTimeThresh"),this,this._timeoutCheck)),this.fire(f,{ev:r})},validClick:function(t){var n=!1,i=!1,s=t.target,o=null,u=null,a=null,f=!1;if(this._handles)e.each(this._handles,function(t,r){t instanceof e.Node||t instanceof e.NodeList?n||(a=t,a instanceof e.Node&&(a=new e.NodeList(t._node)),a.each(function(e){e.contains(s)&&(n=!0)})):e.Lang.isString(r)&&s.test(r+", "+r+" *")&&!o&&(o=r,n=!0)});else{i=this.get(r);if(i.contains(s)||i.compareTo(s))n=!0}return n&&this._invalids&&e.each(this._invalids,function(t,r){e.Lang.isString(r)&&s.test(r+", "+r+" *")&&(n=!1)}),n&&(o?(u=t.currentTarget.all(o),f=!1,u.each(function(e){(e.contains(s)||e.compareTo(s))&&!f&&(f=!0,this.set("activeHandle",e))},this)):this.set("activeHandle",this.get(r))),n},_setStartPosition:function(e){this.startXY=e,this.nodeXY=this.lastXY=this.realXY=this.get(r).getXY(),this.get("offsetNode")?this.deltaXY=[this.startXY[0]-this.nodeXY[0],this.startXY[1]-this.nodeXY[1]]:this.deltaXY=[0,0]},_timeoutCheck:function(){!this.get("lock")&&!this._dragThreshMet&&this._ev_md&&(this._fromTimeout=this._dragThreshMet=!0,this.start(),this._alignNode([this._ev_md.pageX,this._ev_md.pageY],!0))},removeHandle:function(t){var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]&&(delete this._handles[n],this.fire(l,{handle:t})),this},addHandle:function(t){this._handles||(this._handles={});var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]=t,this.fire(c,{handle:t}),this},removeInvalid:function(e){return this._invalids[e]&&(this._invalids[e]=null,delete this._invalids[e],this.fire(h,{handle:e})),this},addInvalid:function(t){return e.Lang.isString(t)&&(this._invalids[t]=!0,this.fire(p,{handle:t})),this},initializer:function(){this.get(r).dd=this;if(!this.get(r).get("id")){var t=e.stamp(this.get(r));this.get(r).set("id",t)}this.actXY=[],this._invalids=e.clone(this._invalidsDefault,!0),this._createEvents(),this.get(s)||this.set(s,this.get(r)),this.on("initializedChange",e.bind(this._prep,this)),this.set("groups",this.get("groups"))},_prep:function(){this._dragThreshMet=!1;var t=this.get(r);t.addClass(n.CSS_PREFIX+"-draggable"),t.on(y.START_EVENT,e.bind(this._handleMouseDownEvent,this)),t.on("mouseup",e.bind(this._handleMouseUp,this)),t.on("dragstart",e.bind(this._fixDragStart,this))},_unprep:function(){var e=this.get(r);e.removeClass(n.CSS_PREFIX+"-draggable"),e.detachAll("mouseup"),e.detachAll("dragstart"),e.detachAll(y.START_EVENT),this.mouseXY=[],this.deltaXY=[0,0],this.startXY=[],this.nodeXY=[],this.lastXY=[],this.actXY=[],this.realXY=[]},start:function(){if(!this.get("lock")&&!this.get(i)){var e=this.get(r),t,a,f;this._startTime=(new Date).getTime(),n._start(),e.addClass(n.CSS_PREFIX+"-dragging"),this.fire(d,{pageX:this.nodeXY[0],pageY:this.nodeXY[1],startTime:this._startTime}),e=this.get(s),f=this.nodeXY,t=e.get(u),a=e.get(o),this.get("startCentered")&&this._setStartPosition([f[0]+t/2,f[1]+a/2]),this.region={0:f[0],1:f[1],area:0,top:f[1],right:f[0]+t,bottom:f[1]+a,left:f[0]},this.set(i,!0)}return this},end:function(){return this._endTime=(new Date).getTime(),this._clickTimeout&&this._clickTimeout.cancel(),this._dragThreshMet=this._fromTimeout=!1,!this.get("lock")&&this.get(i)&&this.fire(v,{pageX:this.lastXY[0],pageY:this.lastXY[1],startTime:this._startTime,endTime:this._endTime}),this.get(r).removeClass(n.CSS_PREFIX+"-dragging"),this.set(i,!1),this.deltaXY=[0,0],this},_defEndFn:function(){this._fixIEMouseUp(),this._ev_md=null},_prevEndFn:function(){this._fixIEMouseUp(),this.get(s).setXY(this.nodeXY),this._ev_md=null,this.region=null},_align:function(e){this.fire(g,{pageX:e[0],pageY:e[1]})},_defAlignFn:function(e){this.actXY=[e.pageX-this.deltaXY[0],e.pageY-this.deltaXY[1]]},_alignNode:function(e,t){this._align(e),t||this._moveNode()},_moveNode:function(e){var t=[],n=[],r=this.nodeXY,i=this.actXY;t[0]=i[0]-this.lastXY[0],t[1]=i[1]-this.lastXY[1],n[0]=i[0]-this.nodeXY[0],n[1]=i[1]-this.nodeXY[1],this.region={0:i[0],1:i[1],area:0,top:i[1],right:i[0]+this.get(s).get(u),bottom:i[1]+this.get(s).get(o),left:i[0]},this.fire(m,{pageX:i[0],pageY:i[1],scroll:e,info:{start:r,xy:i,delta:t,offset:n}}),this.lastXY=i},_defDragFn:function(t){if(this.get("move")){if(t.scroll&&t.scroll.node){var n=t.scroll.node.getDOMNode();n===e.config.win?n.scrollTo(t.scroll.left,t.scroll.top):(t.scroll.node.set("scrollTop",t.scroll.top),t.scroll.node.set("scrollLeft",t.scroll.left))}this.get(s).setXY([t.pageX,t.pageY]),this.realXY=[t.pageX,t.pageY]}},_move:function(e){if(this.get("lock"))return!1;this.mouseXY=[e.pageX,e.pageY];if(!this._dragThreshMet){var t=Math.abs(this.startXY[0]-e.pageX),n=Math.abs(this.startXY[1]-e.pageY);if(t>this.get("clickPixelThresh")||n>this.get("clickPixelThresh"))this._dragThreshMet=!0,this.start(),e&&e.preventDefault&&e.preventDefault(),this._alignNode([e.pageX,e.pageY])}else this._clickTimeout&&this._clickTimeout.cancel(),this._alignNode([e.pageX,e.pageY])},stopDrag:function(){return this.get(i)&&n._end(),this},destructor:function(){this._unprep(),this.target&&this.target.destroy(),n._unregDrag(this)}}),e.namespace("DD"),e.DD.Drag=y},"@VERSION@",{requires:["dd-ddm-base"]});
View
10 build/dd-drag/dd-drag.js
@@ -1200,8 +1200,14 @@ YUI.add('dd-drag', function (Y, NAME) {
_defDragFn: function(e) {
if (this.get('move')) {
if (e.scroll && e.scroll.node) {
- e.scroll.node.set('scrollTop', e.scroll.top);
- e.scroll.node.set('scrollLeft', e.scroll.left);
+ var domNode = e.scroll.node.getDOMNode();
+ //If it's the window
+ if (domNode === Y.config.win) {
+ domNode.scrollTo(e.scroll.left, e.scroll.top);
+ } else {
+ e.scroll.node.set('scrollTop', e.scroll.top);
+ e.scroll.node.set('scrollLeft', e.scroll.left);
+ }
}
this.get(DRAG_NODE).setXY([e.pageX, e.pageY]);
this.realXY = [e.pageX, e.pageY];
View
307 build/get-nodejs/get-coverage.js
@@ -1,307 +0,0 @@
-if (typeof _yuitest_coverage == "undefined"){
- _yuitest_coverage = {};
- _yuitest_coverline = function(src, line){
- var coverage = _yuitest_coverage[src];
- if (!coverage.lines[line]){
- coverage.calledLines++;
- }
- coverage.lines[line]++;
- };
- _yuitest_coverfunc = function(src, name, line){
- var coverage = _yuitest_coverage[src],
- funcId = name + ":" + line;
- if (!coverage.functions[funcId]){
- coverage.calledFunctions++;
- }
- coverage.functions[funcId]++;
- };
-}
-_yuitest_coverage["/build/get/get.js"] = {
- lines: {},
- functions: {},
- coveredLines: 0,
- calledLines: 0,
- coveredFunctions: 0,
- calledFunctions: 0,
- path: "/build/get/get.js",
- code: []
-};
-_yuitest_coverage["/build/get/get.js"].code=["YUI.add('get', function(Y) {",""," /**"," * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed."," * @module get-nodejs"," * @class GetNodeJS"," */"," "," var path = require('path'),"," vm = require('vm'),"," fs = require('fs'),"," request = require('request'),"," existsSync = fs.existsSync || path.existsSync;","",""," Y.Get = function() {"," };",""," //Setup the default config base path"," Y.config.base = path.join(__dirname, '../');",""," YUI.require = require;"," YUI.process = process;"," "," /**"," * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`"," * @method escapeWinPath"," * @protected"," * @param {String} p The path to modify"," * @return {String} The encoded path"," */"," var escapeWinPath = function(p) {"," return p.replace(/\\\\/g, '\\\\\\\\');"," };",""," /**"," * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded"," * into the YUI object"," * @method _exec"," * @private"," * @param {String} data The JS to execute"," * @param {String} url The path to the file that was parsed"," * @param {Callback} cb The callback to execute when this is completed"," * @param {Error} cb.err=null Error object"," * @param {String} cb.url The URL that was just parsed"," */",""," Y.Get._exec = function(data, url, cb) {"," var dirName = escapeWinPath(path.dirname(url));"," var fileName = escapeWinPath(url);",""," if (dirName.match(/^https?:\\/\\//)) {"," dirName = '.';"," fileName = 'remoteResource';"," }",""," var mod = \"(function(YUI) { var __dirname = '\" + dirName + \"'; \"+"," \"var __filename = '\" + fileName + \"'; \" +"," \"var process = YUI.process;\" +"," \"var require = function(file) {\" +"," \" if (file.indexOf('./') === 0) {\" +"," \" file = __dirname + file.replace('./', '/'); }\" +"," \" return YUI.require(file); }; \" +"," data + \" ;return YUI; })\";"," "," //var mod = \"(function(YUI) { \" + data + \";return YUI; })\";"," var script = vm.createScript(mod, url);"," var fn = script.runInThisContext(mod);"," YUI = fn(YUI);"," cb(null, url);"," };"," "," /**"," * Fetches the content from a remote URL or a file from disc and passes the content"," * off to `_exec` for parsing"," * @method _include"," * @private"," * @param {String} url The URL/File path to fetch the content from"," * @param {Callback} cb The callback to fire once the content has been executed via `_exec`"," */"," Y.Get._include = function(url, cb) {"," var self = this;",""," if (url.match(/^https?:\\/\\//)) {"," var cfg = {"," url: url,"," timeout: self.timeout"," };"," request(cfg, function (err, response, body) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(body, url, cb);"," }"," });"," } else {"," if (Y.config.useSync) {"," //Needs to be in useSync"," if (existsSync(url)) {"," var mod = fs.readFileSync(url,'utf8');"," Y.Get._exec(mod, url, cb);"," } else {"," cb('Path does not exist: ' + url, url);"," }"," } else {"," fs.readFile(url, 'utf8', function(err, mod) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(mod, url, cb);"," }"," });"," }"," }"," "," };","",""," var end = function(cb, msg, result) {"," if (Y.Lang.isFunction(cb.onEnd)) {"," cb.onEnd.call(Y, msg, result);"," }"," }, pass = function(cb) {"," if (Y.Lang.isFunction(cb.onSuccess)) {"," cb.onSuccess.call(Y, cb);"," }"," end(cb, 'success', 'success');"," }, fail = function(cb, er) {"," er.errors = [er];"," if (Y.Lang.isFunction(cb.onFailure)) {"," cb.onFailure.call(Y, er, cb);"," }"," end(cb, er, 'fail');"," };","",""," /**"," * Override for Get.script for loading local or remote YUI modules."," * @method js"," * @param {Array|String} s The URL's to load into this context"," * @param {Object} options Transaction options"," */"," Y.Get.js = function(s, options) {"," var A = Y.Array,"," self = this,"," urls = A(s), url, i, l = urls.length, c= 0,"," check = function() {"," if (c === l) {"," pass(options);"," }"," };","","",""," for (i=0; i<l; i++) {"," url = urls[i];"," if (Y.Lang.isObject(url)) {"," url = url.url;"," }",""," url = url.replace(/'/g, '%27');"," Y.Get._include(url, function(err, url) {"," if (!Y.config) {"," Y.config = {"," debug: true"," };"," }"," if (options.onProgress) {"," options.onProgress.call(options.context || Y, url);"," }"," if (err) {"," fail(options, err);"," } else {"," c++;"," check();"," }"," });"," }"," };"," "," /**"," * Alias for `Y.Get.js`"," * @method script"," */"," Y.Get.script = Y.Get.js;"," "," //Place holder for SS Dom access"," Y.Get.css = function(s, cb) {"," pass(cb);"," };","","","","}, '@VERSION@' ,{requires:['yui-base']});"];
-_yuitest_coverage["/build/get/get.js"].lines = {"1":0,"9":0,"16":0,"20":0,"22":0,"23":0,"32":0,"33":0,"48":0,"49":0,"50":0,"52":0,"53":0,"54":0,"57":0,"67":0,"68":0,"69":0,"70":0,"81":0,"82":0,"84":0,"85":0,"89":0,"90":0,"91":0,"93":0,"97":0,"99":0,"100":0,"101":0,"103":0,"106":0,"107":0,"108":0,"110":0,"119":0,"120":0,"121":0,"124":0,"125":0,"127":0,"129":0,"130":0,"131":0,"133":0,"143":0,"144":0,"148":0,"149":0,"155":0,"156":0,"157":0,"158":0,"161":0,"162":0,"163":0,"164":0,"168":0,"169":0,"171":0,"172":0,"174":0,"175":0,"185":0,"188":0,"189":0};
-_yuitest_coverage["/build/get/get.js"].functions = {"escapeWinPath:32":0,"_exec:48":0,"(anonymous 2):89":0,"(anonymous 3):106":0,"_include:81":0,"end:119":0,"pass:123":0,"fail:128":0,"check:147":0,"(anonymous 4):162":0,"js:143":0,"css:188":0,"(anonymous 1):1":0};
-_yuitest_coverage["/build/get/get.js"].coveredLines = 67;
-_yuitest_coverage["/build/get/get.js"].coveredFunctions = 13;
-_yuitest_coverline("/build/get/get.js", 1);
-YUI.add('get', function(Y) {
-
- /**
- * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
- * @module get-nodejs
- * @class GetNodeJS
- */
-
- _yuitest_coverfunc("/build/get/get.js", "(anonymous 1)", 1);
-_yuitest_coverline("/build/get/get.js", 9);
-var path = require('path'),
- vm = require('vm'),
- fs = require('fs'),
- request = require('request'),
- existsSync = fs.existsSync || path.existsSync;
-
-
- _yuitest_coverline("/build/get/get.js", 16);
-Y.Get = function() {
- };
-
- //Setup the default config base path
- _yuitest_coverline("/build/get/get.js", 20);
-Y.config.base = path.join(__dirname, '../');
-
- _yuitest_coverline("/build/get/get.js", 22);
-YUI.require = require;
- _yuitest_coverline("/build/get/get.js", 23);
-YUI.process = process;
-
- /**
- * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
- * @method escapeWinPath
- * @protected
- * @param {String} p The path to modify
- * @return {String} The encoded path
- */
- _yuitest_coverline("/build/get/get.js", 32);
-var escapeWinPath = function(p) {
- _yuitest_coverfunc("/build/get/get.js", "escapeWinPath", 32);
-_yuitest_coverline("/build/get/get.js", 33);
-return p.replace(/\\/g, '\\\\');
- };
-
- /**
- * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
- * into the YUI object
- * @method _exec
- * @private
- * @param {String} data The JS to execute
- * @param {String} url The path to the file that was parsed
- * @param {Callback} cb The callback to execute when this is completed
- * @param {Error} cb.err=null Error object
- * @param {String} cb.url The URL that was just parsed
- */
-
- _yuitest_coverline("/build/get/get.js", 48);
-Y.Get._exec = function(data, url, cb) {
- _yuitest_coverfunc("/build/get/get.js", "_exec", 48);
-_yuitest_coverline("/build/get/get.js", 49);
-var dirName = escapeWinPath(path.dirname(url));
- _yuitest_coverline("/build/get/get.js", 50);
-var fileName = escapeWinPath(url);
-
- _yuitest_coverline("/build/get/get.js", 52);
-if (dirName.match(/^https?:\/\//)) {
- _yuitest_coverline("/build/get/get.js", 53);
-dirName = '.';
- _yuitest_coverline("/build/get/get.js", 54);
-fileName = 'remoteResource';
- }
-
- _yuitest_coverline("/build/get/get.js", 57);
-var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
- "var __filename = '" + fileName + "'; " +
- "var process = YUI.process;" +
- "var require = function(file) {" +
- " if (file.indexOf('./') === 0) {" +
- " file = __dirname + file.replace('./', '/'); }" +
- " return YUI.require(file); }; " +
- data + " ;return YUI; })";
-
- //var mod = "(function(YUI) { " + data + ";return YUI; })";
- _yuitest_coverline("/build/get/get.js", 67);
-var script = vm.createScript(mod, url);
- _yuitest_coverline("/build/get/get.js", 68);
-var fn = script.runInThisContext(mod);
- _yuitest_coverline("/build/get/get.js", 69);
-YUI = fn(YUI);
- _yuitest_coverline("/build/get/get.js", 70);
-cb(null, url);
- };
-
- /**
- * Fetches the content from a remote URL or a file from disc and passes the content
- * off to `_exec` for parsing
- * @method _include
- * @private
- * @param {String} url The URL/File path to fetch the content from
- * @param {Callback} cb The callback to fire once the content has been executed via `_exec`
- */
- _yuitest_coverline("/build/get/get.js", 81);
-Y.Get._include = function(url, cb) {
- _yuitest_coverfunc("/build/get/get.js", "_include", 81);
-_yuitest_coverline("/build/get/get.js", 82);
-var self = this;
-
- _yuitest_coverline("/build/get/get.js", 84);
-if (url.match(/^https?:\/\//)) {
- _yuitest_coverline("/build/get/get.js", 85);
-var cfg = {
- url: url,
- timeout: self.timeout
- };
- _yuitest_coverline("/build/get/get.js", 89);
-request(cfg, function (err, response, body) {
- _yuitest_coverfunc("/build/get/get.js", "(anonymous 2)", 89);
-_yuitest_coverline("/build/get/get.js", 90);
-if (err) {
- _yuitest_coverline("/build/get/get.js", 91);
-cb(err, url);
- } else {
- _yuitest_coverline("/build/get/get.js", 93);
-Y.Get._exec(body, url, cb);
- }
- });
- } else {
- _yuitest_coverline("/build/get/get.js", 97);
-if (Y.config.useSync) {
- //Needs to be in useSync
- _yuitest_coverline("/build/get/get.js", 99);
-if (existsSync(url)) {
- _yuitest_coverline("/build/get/get.js", 100);
-var mod = fs.readFileSync(url,'utf8');
- _yuitest_coverline("/build/get/get.js", 101);
-Y.Get._exec(mod, url, cb);
- } else {
- _yuitest_coverline("/build/get/get.js", 103);
-cb('Path does not exist: ' + url, url);
- }
- } else {
- _yuitest_coverline("/build/get/get.js", 106);
-fs.readFile(url, 'utf8', function(err, mod) {
- _yuitest_coverfunc("/build/get/get.js", "(anonymous 3)", 106);
-_yuitest_coverline("/build/get/get.js", 107);
-if (err) {
- _yuitest_coverline("/build/get/get.js", 108);
-cb(err, url);
- } else {
- _yuitest_coverline("/build/get/get.js", 110);
-Y.Get._exec(mod, url, cb);
- }
- });
- }
- }
-
- };
-
-
- _yuitest_coverline("/build/get/get.js", 119);
-var end = function(cb, msg, result) {
- _yuitest_coverfunc("/build/get/get.js", "end", 119);
-_yuitest_coverline("/build/get/get.js", 120);
-if (Y.Lang.isFunction(cb.onEnd)) {
- _yuitest_coverline("/build/get/get.js", 121);
-cb.onEnd.call(Y, msg, result);
- }
- }, pass = function(cb) {
- _yuitest_coverfunc("/build/get/get.js", "pass", 123);
-_yuitest_coverline("/build/get/get.js", 124);
-if (Y.Lang.isFunction(cb.onSuccess)) {
- _yuitest_coverline("/build/get/get.js", 125);
-cb.onSuccess.call(Y, cb);
- }
- _yuitest_coverline("/build/get/get.js", 127);
-end(cb, 'success', 'success');
- }, fail = function(cb, er) {
- _yuitest_coverfunc("/build/get/get.js", "fail", 128);
-_yuitest_coverline("/build/get/get.js", 129);
-er.errors = [er];
- _yuitest_coverline("/build/get/get.js", 130);
-if (Y.Lang.isFunction(cb.onFailure)) {
- _yuitest_coverline("/build/get/get.js", 131);
-cb.onFailure.call(Y, er, cb);
- }
- _yuitest_coverline("/build/get/get.js", 133);
-end(cb, er, 'fail');
- };
-
-
- /**
- * Override for Get.script for loading local or remote YUI modules.
- * @method js
- * @param {Array|String} s The URL's to load into this context
- * @param {Object} options Transaction options
- */
- _yuitest_coverline("/build/get/get.js", 143);
-Y.Get.js = function(s, options) {
- _yuitest_coverfunc("/build/get/get.js", "js", 143);
-_yuitest_coverline("/build/get/get.js", 144);
-var A = Y.Array,
- self = this,
- urls = A(s), url, i, l = urls.length, c= 0,
- check = function() {
- _yuitest_coverfunc("/build/get/get.js", "check", 147);
-_yuitest_coverline("/build/get/get.js", 148);
-if (c === l) {
- _yuitest_coverline("/build/get/get.js", 149);
-pass(options);
- }
- };
-
-
-
- _yuitest_coverline("/build/get/get.js", 155);
-for (i=0; i<l; i++) {
- _yuitest_coverline("/build/get/get.js", 156);
-url = urls[i];
- _yuitest_coverline("/build/get/get.js", 157);
-if (Y.Lang.isObject(url)) {
- _yuitest_coverline("/build/get/get.js", 158);
-url = url.url;
- }
-
- _yuitest_coverline("/build/get/get.js", 161);
-url = url.replace(/'/g, '%27');
- _yuitest_coverline("/build/get/get.js", 162);
-Y.Get._include(url, function(err, url) {
- _yuitest_coverfunc("/build/get/get.js", "(anonymous 4)", 162);
-_yuitest_coverline("/build/get/get.js", 163);
-if (!Y.config) {
- _yuitest_coverline("/build/get/get.js", 164);
-Y.config = {
- debug: true
- };
- }
- _yuitest_coverline("/build/get/get.js", 168);
-if (options.onProgress) {
- _yuitest_coverline("/build/get/get.js", 169);
-options.onProgress.call(options.context || Y, url);
- }
- _yuitest_coverline("/build/get/get.js", 171);
-if (err) {
- _yuitest_coverline("/build/get/get.js", 172);
-fail(options, err);
- } else {
- _yuitest_coverline("/build/get/get.js", 174);
-c++;
- _yuitest_coverline("/build/get/get.js", 175);
-check();
- }
- });
- }
- };
-
- /**
- * Alias for `Y.Get.js`
- * @method script
- */
- _yuitest_coverline("/build/get/get.js", 185);
-Y.Get.script = Y.Get.js;
-
- //Place holder for SS Dom access
- _yuitest_coverline("/build/get/get.js", 188);
-Y.Get.css = function(s, cb) {
- _yuitest_coverfunc("/build/get/get.js", "css", 188);
-_yuitest_coverline("/build/get/get.js", 189);
-pass(cb);
- };
-
-
-
-}, '@VERSION@' ,{requires:['yui-base']});
View
204 build/get-nodejs/get-debug.js
@@ -1,204 +0,0 @@
-YUI.add('get', function(Y) {
-
- /**
- * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
- * @module get-nodejs
- * @class GetNodeJS
- */
-
- var path = require('path'),
- vm = require('vm'),
- fs = require('fs'),
- request = require('request'),
- existsSync = fs.existsSync || path.existsSync;
-
-
- Y.Get = function() {
- };
-
- //Setup the default config base path
- Y.config.base = path.join(__dirname, '../');
-
- YUI.require = require;
- YUI.process = process;
-
- /**
- * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
- * @method escapeWinPath
- * @protected
- * @param {String} p The path to modify
- * @return {String} The encoded path
- */
- var escapeWinPath = function(p) {
- return p.replace(/\\/g, '\\\\');
- };
-
- /**
- * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
- * into the YUI object
- * @method _exec
- * @private
- * @param {String} data The JS to execute
- * @param {String} url The path to the file that was parsed
- * @param {Callback} cb The callback to execute when this is completed
- * @param {Error} cb.err=null Error object
- * @param {String} cb.url The URL that was just parsed
- */
-
- Y.Get._exec = function(data, url, cb) {
- var dirName = escapeWinPath(path.dirname(url));
- var fileName = escapeWinPath(url);
-
- if (dirName.match(/^https?:\/\//)) {
- dirName = '.';
- fileName = 'remoteResource';
- }
-
- var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
- "var __filename = '" + fileName + "'; " +
- "var process = YUI.process;" +
- "var require = function(file) {" +
- " if (file.indexOf('./') === 0) {" +
- " file = __dirname + file.replace('./', '/'); }" +
- " return YUI.require(file); }; " +
- data + " ;return YUI; })";
-
- //var mod = "(function(YUI) { " + data + ";return YUI; })";
- var script = vm.createScript(mod, url);
- var fn = script.runInThisContext(mod);
- YUI = fn(YUI);
- cb(null, url);
- };
-
- /**
- * Fetches the content from a remote URL or a file from disc and passes the content
- * off to `_exec` for parsing
- * @method _include
- * @private
- * @param {String} url The URL/File path to fetch the content from
- * @param {Callback} cb The callback to fire once the content has been executed via `_exec`
- */
- Y.Get._include = function(url, cb) {
- var self = this;
-
- if (url.match(/^https?:\/\//)) {
- var cfg = {
- url: url,
- timeout: self.timeout
- };
- request(cfg, function (err, response, body) {
- if (err) {
- Y.log(err, 'error', 'get');
- cb(err, url);
- } else {
- Y.Get._exec(body, url, cb);
- }
- });
- } else {
- if (Y.config.useSync) {
- //Needs to be in useSync
- if (existsSync(url)) {
- var mod = fs.readFileSync(url,'utf8');
- Y.Get._exec(mod, url, cb);
- } else {
- cb('Path does not exist: ' + url, url);
- }
- } else {
- fs.readFile(url, 'utf8', function(err, mod) {
- if (err) {
- cb(err, url);
- } else {
- Y.Get._exec(mod, url, cb);
- }
- });
- }
- }
-
- };
-
-
- var end = function(cb, msg, result) {
- //Y.log('Get end: ' + cb.onEnd);
- if (Y.Lang.isFunction(cb.onEnd)) {
- cb.onEnd.call(Y, msg, result);
- }
- }, pass = function(cb) {
- //Y.log('Get pass: ' + cb.onSuccess);
- if (Y.Lang.isFunction(cb.onSuccess)) {
- cb.onSuccess.call(Y, cb);
- }
- end(cb, 'success', 'success');
- }, fail = function(cb, er) {
- //Y.log('Get fail: ' + er);
- er.errors = [er];
- if (Y.Lang.isFunction(cb.onFailure)) {
- cb.onFailure.call(Y, er, cb);
- }
- end(cb, er, 'fail');
- };
-
-
- /**
- * Override for Get.script for loading local or remote YUI modules.
- * @method js
- * @param {Array|String} s The URL's to load into this context
- * @param {Object} options Transaction options
- */
- Y.Get.js = function(s, options) {
- var A = Y.Array,
- self = this,
- urls = A(s), url, i, l = urls.length, c= 0,
- check = function() {
- if (c === l) {
- pass(options);
- }
- };
-
-
-
- for (i=0; i<l; i++) {
- url = urls[i];
- if (Y.Lang.isObject(url)) {
- url = url.url;
- }
-
- url = url.replace(/'/g, '%27');
- Y.log('URL: ' + url, 'info', 'get');
- Y.Get._include(url, function(err, url) {
- if (!Y.config) {
- Y.config = {
- debug: true
- };
- }
- if (options.onProgress) {
- options.onProgress.call(options.context || Y, url);
- }
- Y.log('After Load: ' + url, 'info', 'get');
- if (err) {
- fail(options, err);
- Y.log('----------------------------------------------------------', 'error', 'get');
- Y.log(err, 'error', 'get');
- Y.log('----------------------------------------------------------', 'error', 'get');
- } else {
- c++;
- check();
- }
- });
- }
- };
-
- /**
- * Alias for `Y.Get.js`
- * @method script
- */
- Y.Get.script = Y.Get.js;
-
- //Place holder for SS Dom access
- Y.Get.css = function(s, cb) {
- Y.log('Y.Get.css is not supported, just reporting that it has loaded but not fetching.', 'warn', 'get');
- pass(cb);
- };
-
-
-
-}, '@VERSION@' ,{requires:['yui-base']});
View
1 build/get-nodejs/get-min.js
@@ -1 +0,0 @@
-YUI.add("get",function(a){var j=require("path"),b=require("vm"),f=require("fs"),e=require("request"),g=f.existsSync||j.existsSync;a.Get=function(){};a.config.base=j.join(__dirname,"../");YUI.require=require;YUI.process=process;var i=function(k){return k.replace(/\\/g,"\\\\");};a.Get._exec=function(q,m,k){var p=i(j.dirname(m));var r=i(m);if(p.match(/^https?:\/\//)){p=".";r="remoteResource";}var n="(function(YUI) { var __dirname = '"+p+"'; "+"var __filename = '"+r+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+q+" ;return YUI; })";var l=b.createScript(n,m);var o=l.runInThisContext(n);YUI=o(YUI);k(null,m);};a.Get._include=function(n,k){var m=this;if(n.match(/^https?:\/\//)){var l={url:n,timeout:m.timeout};e(l,function(r,q,p){if(r){k(r,n);}else{a.Get._exec(p,n,k);}});}else{if(a.config.useSync){if(g(n)){var o=f.readFileSync(n,"utf8");a.Get._exec(o,n,k);}else{k("Path does not exist: "+n,n);}}else{f.readFile(n,"utf8",function(q,p){if(q){k(q,n);}else{a.Get._exec(p,n,k);}});}}};var d=function(l,m,k){if(a.Lang.isFunction(l.onEnd)){l.onEnd.call(a,m,k);}},h=function(k){if(a.Lang.isFunction(k.onSuccess)){k.onSuccess.call(a,k);}d(k,"success","success");},c=function(k,l){l.errors=[l];if(a.Lang.isFunction(k.onFailure)){k.onFailure.call(a,l,k);}d(k,l,"fail");};a.Get.js=function(u,v){var n=a.Array,t=this,r=n(u),k,p,o=r.length,q=0,m=function(){if(q===o){h(v);}};for(p=0;p<o;p++){k=r[p];if(a.Lang.isObject(k)){k=k.url;}k=k.replace(/'/g,"%27");a.Get._include(k,function(s,l){if(!a.config){a.config={debug:true};}if(v.onProgress){v.onProgress.call(v.context||a,l);}if(s){c(v,s);}else{q++;m();}});}};a.Get.script=a.Get.js;a.Get.css=function(l,k){h(k);};},"@VERSION@",{requires:["yui-base"]});
View
194 build/get-nodejs/get.js
@@ -1,194 +0,0 @@
-YUI.add('get', function(Y) {
-
- /**
- * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
- * @module get-nodejs
- * @class GetNodeJS
- */
-
- var path = require('path'),
- vm = require('vm'),
- fs = require('fs'),
- request = require('request'),
- existsSync = fs.existsSync || path.existsSync;
-
-
- Y.Get = function() {
- };
-
- //Setup the default config base path
- Y.config.base = path.join(__dirname, '../');
-
- YUI.require = require;
- YUI.process = process;
-
- /**
- * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
- * @method escapeWinPath
- * @protected
- * @param {String} p The path to modify
- * @return {String} The encoded path
- */
- var escapeWinPath = function(p) {
- return p.replace(/\\/g, '\\\\');
- };
-
- /**
- * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
- * into the YUI object
- * @method _exec
- * @private
- * @param {String} data The JS to execute
- * @param {String} url The path to the file that was parsed
- * @param {Callback} cb The callback to execute when this is completed
- * @param {Error} cb.err=null Error object
- * @param {String} cb.url The URL that was just parsed
- */
-
- Y.Get._exec = function(data, url, cb) {
- var dirName = escapeWinPath(path.dirname(url));
- var fileName = escapeWinPath(url);
-
- if (dirName.match(/^https?:\/\//)) {
- dirName = '.';
- fileName = 'remoteResource';
- }
-
- var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
- "var __filename = '" + fileName + "'; " +
- "var process = YUI.process;" +
- "var require = function(file) {" +
- " if (file.indexOf('./') === 0) {" +
- " file = __dirname + file.replace('./', '/'); }" +
- " return YUI.require(file); }; " +
- data + " ;return YUI; })";
-
- //var mod = "(function(YUI) { " + data + ";return YUI; })";
- var script = vm.createScript(mod, url);
- var fn = script.runInThisContext(mod);
- YUI = fn(YUI);
- cb(null, url);
- };
-
- /**
- * Fetches the content from a remote URL or a file from disc and passes the content
- * off to `_exec` for parsing
- * @method _include
- * @private
- * @param {String} url The URL/File path to fetch the content from
- * @param {Callback} cb The callback to fire once the content has been executed via `_exec`
- */
- Y.Get._include = function(url, cb) {
- var self = this;
-
- if (url.match(/^https?:\/\//)) {
- var cfg = {
- url: url,
- timeout: self.timeout
- };
- request(cfg, function (err, response, body) {
- if (err) {
- cb(err, url);
- } else {
- Y.Get._exec(body, url, cb);
- }
- });
- } else {
- if (Y.config.useSync) {
- //Needs to be in useSync
- if (existsSync(url)) {
- var mod = fs.readFileSync(url,'utf8');
- Y.Get._exec(mod, url, cb);
- } else {
- cb('Path does not exist: ' + url, url);
- }
- } else {
- fs.readFile(url, 'utf8', function(err, mod) {
- if (err) {
- cb(err, url);
- } else {
- Y.Get._exec(mod, url, cb);
- }
- });
- }
- }
-
- };
-
-
- var end = function(cb, msg, result) {
- if (Y.Lang.isFunction(cb.onEnd)) {
- cb.onEnd.call(Y, msg, result);
- }
- }, pass = function(cb) {
- if (Y.Lang.isFunction(cb.onSuccess)) {
- cb.onSuccess.call(Y, cb);
- }
- end(cb, 'success', 'success');
- }, fail = function(cb, er) {
- er.errors = [er];
- if (Y.Lang.isFunction(cb.onFailure)) {
- cb.onFailure.call(Y, er, cb);
- }
- end(cb, er, 'fail');
- };
-
-
- /**
- * Override for Get.script for loading local or remote YUI modules.
- * @method js
- * @param {Array|String} s The URL's to load into this context
- * @param {Object} options Transaction options
- */
- Y.Get.js = function(s, options) {
- var A = Y.Array,
- self = this,
- urls = A(s), url, i, l = urls.length, c= 0,
- check = function() {
- if (c === l) {
- pass(options);
- }
- };
-
-
-
- for (i=0; i<l; i++) {
- url = urls[i];
- if (Y.Lang.isObject(url)) {
- url = url.url;
- }
-
- url = url.replace(/'/g, '%27');
- Y.Get._include(url, function(err, url) {
- if (!Y.config) {
- Y.config = {
- debug: true
- };
- }
- if (options.onProgress) {
- options.onProgress.call(options.context || Y, url);
- }
- if (err) {
- fail(options, err);
- } else {
- c++;
- check();
- }
- });
- }
- };
-
- /**
- * Alias for `Y.Get.js`
- * @method script
- */
- Y.Get.script = Y.Get.js;
-
- //Place holder for SS Dom access
- Y.Get.css = function(s, cb) {
- pass(cb);
- };
-
-
-
-}, '@VERSION@' ,{requires:['yui-base']});
View
5 src/dd/docs/index.mustache
@@ -453,8 +453,3 @@ YUI().use('dd-delegate', function(Y) {
</tbody>
</table>
-<h2 id="issues">Known Issues</h2>
-
-<p>
-As of 3.6.0, window scrolling does not work properly on Safari 6 (build 8536.25) due to a regression in it's viewport reporting.
-</p>
View
10 src/dd/js/drag.js
@@ -1201,8 +1201,14 @@
_defDragFn: function(e) {
if (this.get('move')) {
if (e.scroll && e.scroll.node) {
- e.scroll.node.set('scrollTop', e.scroll.top);
- e.scroll.node.set('scrollLeft', e.scroll.left);
+ var domNode = e.scroll.node.getDOMNode();
+ //If it's the window
+ if (domNode === Y.config.win) {
+ domNode.scrollTo(e.scroll.left, e.scroll.top);
+ } else {
+ e.scroll.node.set('scrollTop', e.scroll.top);
+ e.scroll.node.set('scrollLeft', e.scroll.left);
+ }
}
this.get(DRAG_NODE).setXY([e.pageX, e.pageY]);
this.realXY = [e.pageX, e.pageY];

No commit comments for this range

Something went wrong with that request. Please try again.