[FIX] web_editor: get size of resizable elements on mouse down

Get the elements size also on mousedown. Because before that, the
size was only obtained on the start method when some elements did not
yet have its actual size. Example: elements in inactive slides in the
carousel snippet.

task-2162952

closes odoo/odoo#48193

X-original-commit: 2a36c684bb33704e46a6f30b5c501043683da67d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Benjamin Vray
2020-03-23 12:42:02 +00:00
committed by qsm-odoo
parent 3998fa8dc1
commit 1e35fffc89
@@ -2224,6 +2224,9 @@ registry.sizing = SnippetOptionWidget.extend({
this.$handles.on('mousedown', function (ev) {
ev.preventDefault();
// First update size values as some element sizes may not have been
// initialized on option start (hidden slides, etc)
resizeValues = self._getSize();
var $handle = $(ev.currentTarget);
var compass = false;