diff options
Diffstat (limited to 'addons/web/static/tests/helpers/test_utils.js')
| -rw-r--r-- | addons/web/static/tests/helpers/test_utils.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js index c2828802891..fc26aa80713 100644 --- a/addons/web/static/tests/helpers/test_utils.js +++ b/addons/web/static/tests/helpers/test_utils.js @@ -414,10 +414,11 @@ function dragAndDrop($el, $to, options) { var toOffset = $to.offset(); toOffset.top += $to.outerHeight()/2; toOffset.left += $to.outerWidth()/2; + var vertical_offset = (toOffset.top < elementCenter.top) ? -1 : 1; if (position === 'top') { - toOffset.top -= $to.outerHeight()/2; + toOffset.top -= $to.outerHeight()/2 + vertical_offset; } else if (position === 'bottom') { - toOffset.top += $to.outerHeight()/2; + toOffset.top += $to.outerHeight()/2 - vertical_offset; } else if (position === 'left') { toOffset.left -= $to.outerWidth()/2; } else if (position === 'right') { |
