summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/menu
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-07-26 15:12:29 +0200
committerChristophe Simonis <chs@odoo.com>2019-07-26 15:12:29 +0200
commitbfd34e14b1be97465e135d85c76b9e626a219e7a (patch)
tree8de54ec8f504158e965ab92e21658cab539024ee /addons/website/static/src/js/menu
parent26b5b446b3dab3d66b7db054ca77e7b1a811c28a (diff)
parent40e8b67179f212551a176d72b3851671febc1fba (diff)
[MERGE] forward port branch saas-12.3 up to 40e8b67179f
Diffstat (limited to 'addons/website/static/src/js/menu')
-rw-r--r--addons/website/static/src/js/menu/edit.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/addons/website/static/src/js/menu/edit.js b/addons/website/static/src/js/menu/edit.js
index a08ca136131..a601ae3fb8a 100644
--- a/addons/website/static/src/js/menu/edit.js
+++ b/addons/website/static/src/js/menu/edit.js
@@ -21,6 +21,7 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
custom_events: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.custom_events || {}, {
content_will_be_destroyed: '_onContentWillBeDestroyed',
content_was_recreated: '_onContentWasRecreated',
+ snippet_will_be_cloned: '_onSnippetWillBeCloned',
snippet_cloned: '_onSnippetCloned',
snippet_dropped: '_onSnippetDropped',
edition_will_stopped: '_onEditionWillStop',
@@ -204,8 +205,21 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
this.editModeEnable = false;
},
/**
+ * Called when a snippet is about to be cloned in the page. Notifies the
+ * WebsiteRoot that is should destroy the animations for this snippet.
+ *
+ * @private
+ * @param {OdooEvent} ev
+ */
+ _onSnippetWillBeCloned: function (ev) {
+ this.trigger_up('animation_stop_demand', {
+ $target: ev.data.$target,
+ });
+ },
+ /**
* Called when a snippet is cloned in the page. Notifies the WebsiteRoot
- * that is should start the public widgets for this snippet.
+ * that is should start the public widgets for this snippet and the snippet it
+ * was cloned from.
*
* @private
* @param {OdooEvent} ev
@@ -215,6 +229,13 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
editableMode: true,
$target: ev.data.$target,
});
+ // TODO: remove in saas-12.5, undefined $origin will restart #wrapwrap
+ if (ev.data.$origin) {
+ this.trigger_up('widgets_start_request', {
+ editableMode: true,
+ $target: ev.data.$origin,
+ });
+ }
},
/**
* Called when a snippet is dropped in the page. Notifies the WebsiteRoot