diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js index cf837b9df7c..7104a323040 100644 --- a/addons/website/static/src/js/content/website_root.js +++ b/addons/website/static/src/js/content/website_root.js @@ -39,6 +39,7 @@ var WebsiteRoot = BodyManager.extend({ 'click .js_change_lang': '_onLangChangeClick', 'click .js_publish_management .js_publish_btn': '_onPublishBtnClick', 'submit .js_website_submit_form': '_onWebsiteFormSubmit', + 'click .js_disable_on_click': '_onDisableOnClick', }), custom_events: _.extend({}, BodyManager.prototype.custom_events || {}, { animation_start_demand: '_onAnimationStartDemand', @@ -224,6 +225,16 @@ var WebsiteRoot = BodyManager.extend({ $btn.button('loading'); }); }, + /** + * Called when the root is notified that the button should be + * disabled after the first click. + * + * @private + * @param {Event} ev + */ + _onDisableOnClick: function (ev) { + $(ev.currentTarget).addClass('disabled'); + }, }); return { diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 8447cc766b1..3f2046739d2 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -571,7 +571,7 @@
This page does not exists, but you can create it as you are administrator of this site.
- Create Page + Create Page