diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-07-26 11:32:43 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-07-26 11:32:43 +0200 |
| commit | e0f9c092ccefc0516d06a9dc7f66e650eee888cf (patch) | |
| tree | 0c404769dc28af133425cf9756a83569c70b31f3 /addons/website/static/src/js | |
| parent | 7d78795f8b34bc6a8afde18427a1c26901824db3 (diff) | |
| parent | 1d6d790513e3f1177dc0059f2ba4a06de6d87ac2 (diff) | |
[MERGE] forward port branch saas-12.2 up to 1d6d790513e
Diffstat (limited to 'addons/website/static/src/js')
| -rw-r--r-- | addons/website/static/src/js/menu/edit.js | 23 |
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 |
