[FIX] website: fix duplicating a snippet remove its id

Issue

	- Install website
	- Create a carousel
	- Duplicate it

	The second one doesn't work

Cause

	Because of this override:
	https://github.com/odoo/odoo/blob/13.0/addons/website/static/src/js/editor/snippets.options.js#L1635:L1637

	All duplicate IDs are removed but
	it should only remove the ID of a duplicated
	anchor

Solution

	Check if the target has `data-anchor` attribute

OPW-2222074

closes odoo/odoo#48790

X-original-commit: 6f0a4f1aea6ca78413d868f49b9ce105ce14e784
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
This commit is contained in:
jvm-odoo
2020-04-01 20:40:16 +00:00
parent 222aa42512
commit aafee08bc6
@@ -1551,7 +1551,8 @@ options.registry.anchor = options.Class.extend({
* @override
*/
onClone: function () {
this.$target.removeAttr('id data-anchor');
this.$target.removeAttr('data-anchor');
this.$target.filter(':not(.carousel)').removeAttr('id');
},
//--------------------------------------------------------------------------