summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2018-07-05 11:27:27 +0200
committerRomain Derie <rde@odoo.com>2018-07-05 12:42:01 +0200
commit21f1a593a1fed08053918a31ff9f6d239df2dbca (patch)
tree67adfc8bd4897790ef19d9f7811873142d8d6488 /addons
parent26d384ef61e7f246df114489bb703f522c9f252b (diff)
[FIX] website: new content links not triggered
Clicking outside the new content options should close the overlay. Every options are triggering a JS event (mostly opening a modal) that works fine. But the 'New Job offer' options is simply a href link which is not going through anymore since there was a call to `preventDefault`. opw-1860196
Diffstat (limited to 'addons')
-rw-r--r--addons/website/static/src/js/menu/new_content.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/addons/website/static/src/js/menu/new_content.js b/addons/website/static/src/js/menu/new_content.js
index f2d02534f68..c577858f3eb 100644
--- a/addons/website/static/src/js/menu/new_content.js
+++ b/addons/website/static/src/js/menu/new_content.js
@@ -14,7 +14,8 @@ var NewContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
new_page: '_createNewPage',
}),
events: _.extend({}, websiteNavbarData.WebsiteNavbarActionWidget.prototype.events || {}, {
- 'click > a, #o_new_content_menu_choices': '_onMenuToggleClick',
+ 'click > a': '_onMenuToggleClick',
+ 'click > #o_new_content_menu_choices': '_onBackgroundClick',
}),
/**
@@ -65,7 +66,6 @@ var NewContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
/**
* Called when the menu's toggle button is clicked -> Opens the menu.
- * Or when there is a click outside the menu's options -> Closes the menu
*
* @private
* @param {Event} ev
@@ -74,6 +74,15 @@ var NewContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
ev.preventDefault();
this.$newContentMenuChoices.toggleClass('o_hidden');
},
+ /**
+ * Called when a click outside the menu's options occurs -> Closes the menu
+ *
+ * @private
+ * @param {Event} ev
+ */
+ _onBackgroundClick: function (ev) {
+ this.$newContentMenuChoices.addClass('o_hidden');
+ },
});
websiteNavbarData.websiteNavbarRegistry.add(NewContentMenu, '.o_new_content_menu');