Skip to content

Commit d4569a3

Browse files
Refresh Dynamic Snippet Carousel when scrolling mode is changed
1 parent 0973924 commit d4569a3

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { DynamicSnippetCarousel } from "@website/snippets/s_dynamic_snippet_carousel/dynamic_snippet_carousel";
2+
import { registry } from "@web/core/registry";
3+
4+
const DynamicSnippetCarouselEdit = (I) =>
5+
class extends I {
6+
getConfigurationSnapshot() {
7+
let snapshot = super.getConfigurationSnapshot();
8+
if (this.el.classList.contains("o_carousel_multi_items")) {
9+
snapshot = JSON.parse(snapshot || "{}");
10+
snapshot.multi_items = true;
11+
snapshot = JSON.stringify(snapshot);
12+
}
13+
return snapshot;
14+
}
15+
};
16+
17+
registry.category("public.interactions.edit").add("website.dynamic_snippet_carousel", {
18+
Interaction: DynamicSnippetCarousel,
19+
mixin: DynamicSnippetCarouselEdit,
20+
});

addons/website/static/src/snippets/s_dynamic_snippet_carousel/dynamic_snippet_carousel.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,3 @@ export class DynamicSnippetCarousel extends DynamicSnippet {
2828
registry
2929
.category("public.interactions")
3030
.add("website.dynamic_snippet_carousel", DynamicSnippetCarousel);
31-
32-
registry
33-
.category("public.interactions.edit")
34-
.add("website.dynamic_snippet_carousel", {
35-
Interaction: DynamicSnippetCarousel,
36-
});

0 commit comments

Comments
 (0)