summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/menu
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-12-04 17:11:57 +0100
committerChristophe Simonis <chs@odoo.com>2018-12-04 17:11:57 +0100
commitd4c65a7edee8ebe3c5b27d6eea42ebc119fbe085 (patch)
tree3e000dd98e9784b5eebca38019379fa167a0d49b /addons/website/static/src/js/menu
parentc0eef4271110ebcab07811328a7b3f4309fb4d06 (diff)
parent2156af480fddc09b5897b349c04c4c9a2d67c802 (diff)
[MERGE] forward port branch 11.0 up to 2156af480fd
Diffstat (limited to 'addons/website/static/src/js/menu')
-rw-r--r--addons/website/static/src/js/menu/edit.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/addons/website/static/src/js/menu/edit.js b/addons/website/static/src/js/menu/edit.js
index 0397b1f8aca..40da42a82d4 100644
--- a/addons/website/static/src/js/menu/edit.js
+++ b/addons/website/static/src/js/menu/edit.js
@@ -17,6 +17,9 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
edit: '_startEditMode',
}),
custom_events: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.custom_events || {}, {
+ content_will_be_destroyed: '_onContentWillBeDestroyed',
+ content_was_recreated: '_onContentWasRecreated',
+ snippet_cloned: '_onSnippetCloned',
snippet_dropped: '_onSnippetDropped',
}),
@@ -88,6 +91,44 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
//--------------------------------------------------------------------------
/**
+ * Called when content will be destroyed in the page. Notifies the
+ * WebsiteRoot that is should stop the animations.
+ *
+ * @private
+ * @param {OdooEvent} ev
+ */
+ _onContentWillBeDestroyed: function (ev) {
+ this.trigger_up('animation_stop_demand', {
+ $target: ev.data.$target,
+ });
+ },
+ /**
+ * Called when content will be recreated in the page. Notifies the
+ * WebsiteRoot that is should start the animations.
+ *
+ * @private
+ * @param {OdooEvent} ev
+ */
+ _onContentWasRecreated: function (ev) {
+ this.trigger_up('animation_start_demand', {
+ editableMode: true,
+ $target: ev.data.$target,
+ });
+ },
+ /**
+ * Called when a snippet is cloned in the page. Notifies the WebsiteRoot
+ * that is should start the animations for this snippet.
+ *
+ * @private
+ * @param {OdooEvent} ev
+ */
+ _onSnippetCloned: function (ev) {
+ this.trigger_up('animation_start_demand', {
+ editableMode: true,
+ $target: ev.data.$target,
+ });
+ },
+ /**
* Called when a snippet is dropped in the page. Notifies the WebsiteRoot
* that is should start the animations for this snippet.
*