Skip to content

Commit 40157b5

Browse files
committed
accomodate position difference when containment is specified
1 parent 1cf628a commit 40157b5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/angular-sortable-view.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@
444444
targetLeft = containmentRect.left + body.scrollLeft;
445445
if(targetLeft + helperRect.width > containmentRect.left + body.scrollLeft + containmentRect.width) // right boundary
446446
targetLeft = containmentRect.left + body.scrollLeft + containmentRect.width - helperRect.width;
447+
448+
targetLeft -= containmentRect.left;
449+
targetTop -= containmentRect.top;
447450
}
448451
this.style.left = targetLeft - body.scrollLeft + 'px';
449452
this.style.top = targetTop - body.scrollTop + 'px';
@@ -622,4 +625,4 @@
622625
};
623626
}
624627

625-
})(window, window.angular);
628+
})(window, window.angular);

src/angular-sortable-view.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)