diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-07-25 18:38:32 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-07-25 18:38:32 +0200 |
| commit | b82df99d7a86fa3bc2670f00a0ef025263362cda (patch) | |
| tree | 40e4adacf341e6fe3b441d1272881d0f0738e70e /addons/website | |
| parent | 7702d07d39eadf700faad67da42bfee10fb0cd93 (diff) | |
| parent | 5f419d4ad33a56c9c57893b749ab460574481d01 (diff) | |
[MERGE] forward port branch saas-11.3 up to 5f419d4ad33
Diffstat (limited to 'addons/website')
| -rw-r--r-- | addons/website/models/website.py | 2 | ||||
| -rw-r--r-- | addons/website/static/src/js/menu/edit.js | 23 |
2 files changed, 23 insertions, 2 deletions
diff --git a/addons/website/models/website.py b/addons/website/models/website.py index 295d6484df5..a5f4202e4a2 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -1331,6 +1331,6 @@ class WebsiteRedirect(models.Model): type = fields.Selection([('301', 'Moved permanently (301)'), ('302', 'Moved temporarily (302)')], string='Redirection Type', required=True, default='301') url_from = fields.Char('Redirect From', required=True) url_to = fields.Char('Redirect To', required=True) - website_id = fields.Many2one('website', 'Website') + website_id = fields.Many2one('website', 'Website', ondelete='cascade') active = fields.Boolean(default=True) sequence = fields.Integer() diff --git a/addons/website/static/src/js/menu/edit.js b/addons/website/static/src/js/menu/edit.js index a3015a78a6a..6591b51738d 100644 --- a/addons/website/static/src/js/menu/edit.js +++ b/addons/website/static/src/js/menu/edit.js @@ -20,6 +20,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', }), @@ -147,8 +148,21 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ }); }, /** + * 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 animations for this snippet. + * that is should start the animations for this snippet and the snippet it + * was cloned from. * * @private * @param {OdooEvent} ev @@ -158,6 +172,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('animation_start_demand', { + editableMode: true, + $target: ev.data.$origin, + }); + } }, /** * Called when a snippet is dropped in the page. Notifies the WebsiteRoot |
