Skip to content
Snippets Groups Projects
Commit 3860d576 authored by Benoit Socias's avatar Benoit Socias
Browse files

[FIX] website: avoid failing switching mode while image is selected

Since [1] an error is raised when switching the Mode of an Images Wall
from Float to Grid or Masonry while an image is selected.
The display of the size of the image is being updated while its option
panel is not there anymore.

This commit prevents this error from happening by setting up the grid
layout with clones of the images instead of the images themselves.
This leads to the construction of a new editor for the new image.

Steps to reproduce:
- Drop an Images Wall snippet.
- Switch Mode to Float.
- Select an image.
- Switch Mode to Grid.

=> Traceback.

[1]: https://github.com/odoo/odoo/commit/2cbb691a84ce186ddd34a2a4c76d95671ed6e834



task-2990053

closes odoo/odoo#125396

X-original-commit: ef3d8aa2
Signed-off-by: default avatarBenjamin Vray (bvr) <bvr@odoo.com>
parent b772cb4e
No related branches found
No related tags found
No related merge requests found
......@@ -180,7 +180,7 @@ options.registry.gallery = options.Class.extend({
var $container = this._replaceContent($row);
_.each(imgs, function (img, index) {
var $img = $(img);
const $img = $(img.cloneNode());
var $col = $('<div/>', {class: colClass});
$col.append($img).appendTo($row);
if ((index + 1) % columns === 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment