summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/core/smooth_scroll_on_drag.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web/static/src/js/core/smooth_scroll_on_drag.js b/addons/web/static/src/js/core/smooth_scroll_on_drag.js
index 71ea347ed9d..a53323174cf 100644
--- a/addons/web/static/src/js/core/smooth_scroll_on_drag.js
+++ b/addons/web/static/src/js/core/smooth_scroll_on_drag.js
@@ -21,25 +21,25 @@ const OffsetElementsHelper = Class.extend({
this.offsetElements = offsetElements;
},
top: function () {
- if (!this.offsetElements.$top) {
+ if (!this.offsetElements.$top || !this.offsetElements.$top.length) {
return 0;
}
return this.offsetElements.$top.get(0).getBoundingClientRect().bottom;
},
right: function () {
- if (!this.offsetElements.$right) {
+ if (!this.offsetElements.$right || !this.offsetElements.$right.length) {
return 0;
}
return this.offsetElements.$right.get(0).getBoundingClientRect().left;
},
bottom: function () {
- if (!this.offsetElements.$bottom) {
+ if (!this.offsetElements.$bottom || !this.offsetElements.$bottom.length) {
return 0;
}
return this.offsetElements.$bottom.get(0).getBoundingClientRect().top;
},
left: function () {
- if (!this.offsetElements.$left) {
+ if (!this.offsetElements.$left || !this.offsetElements.$left.length) {
return 0;
}
return this.offsetElements.$left.get(0).getBoundingClientRect().right;