diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index aad19ff5da9..ef1afe88d47 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -1148,13 +1148,7 @@ website.snippet.editorRegistry.slider = website.snippet.editorRegistry.resize.extend({ drop_and_build_snippet: function() { - var id = 0; - $(".carousel").each(function () { - var _id = +$(this).attr("id").replace(/^[^a-z]+/i, ''); - if (id <= _id) { - id = _id + 1; - } - }); + var id = $(".carousel").length; this.id = "myCarousel" + id; this.$target.attr("id", this.id); this.$target.find(".carousel-control").attr("href", "#myCarousel" + id);