Skip to content

Commit a521b46

Browse files
committed
Apply mattsonic's scroll container fix
See https://github.com/buberdds/angular-bootstrap- colorpicker/issues/46#issuecomment-57072783
1 parent 4cdbd1a commit a521b46

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

js/bootstrap-colorpicker-module.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ angular.module('colorpicker.module', [])
1414
x = 0,
1515
y = 0,
1616
scrollX = 0,
17-
scrollY = 0;
17+
scrollY = 0,
18+
rect = elem.getBoundingClientRect();
1819
while (elem && !isNaN(elem.offsetLeft) && !isNaN(elem.offsetTop)) {
1920
x += elem.offsetLeft;
2021
y += elem.offsetTop;
@@ -27,6 +28,8 @@ angular.module('colorpicker.module', [])
2728
}
2829
elem = elem.offsetParent;
2930
}
31+
x = rect.left;
32+
y = rect.top;
3033
return {
3134
top: y,
3235
left: x,

js/bootstrap-colorpicker-module.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)