[FIX] website: fix images loading on Images Wall masonry layout

On Chrome, and while adding a new image to Images Wall snippet (on
"masonry" layout), The layout adaptation method will remove the snippet
content to reinsert new images.

Sometimes, the appended images are invisible and not correctly loaded
(only when Chrome cache is enabled).

In this commit, we append a "clone" of each image to the snippet
container to prevent this behaviour.

opw-3240231

closes odoo/odoo#118658

X-original-commit: https://github.com/odoo/odoo/commit/0d43aec24baad6420e0fe150a9c19d33c0b74198
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
xO-Tx
2023-04-18 13:47:23 +02:00
parent 19624e51d1
commit 2ecf25daf8
@@ -207,7 +207,10 @@ options.registry.gallery = options.Class.extend({
$lowest = $col;
}
});
$lowest.append(imgs.shift());
// Only on Chrome: appended images are sometimes invisible and not
// correctly loaded from cache, we use a clone of the image to force
// the loading.
$lowest.append(imgs.shift().cloneNode());
}
},
/**