diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-08-01 17:23:03 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-08-01 17:23:03 +0200 |
| commit | 8d9366197e174d33fdf6962364a24ea40a1131b1 (patch) | |
| tree | a900c27006510633f14827b00b80df8f01eeef1a /addons/web/static/tests/helpers/test_utils.js | |
| parent | 8be798375eadefb6b66e3065a1af3f5eef9ab78a (diff) | |
| parent | 691dd65e0ecca5ef1ab4fa1ff363562a9349c1d4 (diff) | |
[MERGE] forward port branch saas-11.3 up to 691dd65e0ec
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 6c05076ef98..4720d166a4c 100644 --- a/addons/web/static/tests/helpers/test_utils.js +++ b/addons/web/static/tests/helpers/test_utils.js @@ -547,10 +547,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') { |
