diff --git a/addons/website/static/src/js/menu/edit.js b/addons/website/static/src/js/menu/edit.js index 9fd0edd169c..fc5532a3a29 100644 --- a/addons/website/static/src/js/menu/edit.js +++ b/addons/website/static/src/js/menu/edit.js @@ -15,6 +15,7 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ xmlDependencies: ['/website/static/src/xml/website.editor.xml'], actions: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.prototype.actions, { edit: '_startEditMode', + on_save: '_onSave', }), custom_events: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.custom_events || {}, { snippet_dropped: '_onSnippetDropped', @@ -89,6 +90,19 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ return def; }); }, + /** + * On save, the editor will ask to parent widgets if something needs to be + * done first. The website navbar will receive that demand and asks to its + * action-capable components to do something. For example, the content menu + * handles page-related options saving. However, some users with limited + * access rights do not have the content menu... but the website navbar + * expects that the save action is performed. So, this empty action is + * defined here so that all users have an 'on_save' related action. + * + * @private + * @todo improve the system to somehow declare required/optional actions + */ + _onSave: function () {}, //-------------------------------------------------------------------------- // Handlers