Permalink
Browse files

Fixes #2531340 - Align now fired on scroll so constraining works now

  • Loading branch information...
1 parent 67bffd0 commit 2ba627a0fa1e912250df2a0ae0c4973e1bb89dfd @davglass committed May 15, 2012
Showing with 13 additions and 3 deletions.
  1. +5 −3 src/dd/js/drag.js
  2. +8 −0 src/dd/js/scroll.js
View
@@ -1138,9 +1138,11 @@
* @description This method performs the alignment before the element move.
* @param {Array} eXY The XY to move the element to, usually comes from the mousemove DOM event.
*/
- _alignNode: function(eXY) {
+ _alignNode: function(eXY, scroll) {
this._align(eXY);
- this._moveNode();
+ if (!scroll) {
+ this._moveNode();
+ }
},
/**
* @private
@@ -1192,7 +1194,7 @@
*/
_defDragFn: function(e) {
if (this.get('move')) {
- if (e.scroll) {
+ if (e.scroll && e.scroll.node) {
e.scroll.node.set('scrollTop', e.scroll.top);
e.scroll.node.set('scrollLeft', e.scroll.left);
}
View
@@ -233,8 +233,16 @@
if (nl < 0) {
nl = xy[0];
}
+ if (ho.con) {
+ if (!ho.con.inRegion([nl + sl, nt + st])) {
+ move = false;
+ }
+ }
if (move) {
ho.actXY = [nl, nt];
+ ho._alignNode([nl, nt], true); //We are srolling..
+ xy = ho.actXY;
+ ho.actXY = [nl, nt];
ho._moveNode({ node: win, top: st, left: sl});
if (!st && !sl) {
this._cancelScroll();

0 comments on commit 2ba627a

Please sign in to comment.