[FIX] mail: hide activity menu dropdown on activity icon click

Before this commit, The dropdown menu remained open after clicking on
activity icon.

After this commit, The dropdown menu is closed whenever the activity
icon is clicked.

Task-Id: 2047408

closes: #35568

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Kaushalya Mandaliya
2019-08-14 12:16:28 +00:00
committed by Alexandre Kühn
parent dad863d305
commit 2ba725df61
2 changed files with 8 additions and 1 deletions
@@ -108,6 +108,7 @@ var ActivityMenu = Widget.extend({
*/
_onActivityActionClick: function (ev) {
ev.stopPropagation();
this.$('.dropdown-toggle').dropdown('toggle');
var targetAction = $(ev.currentTarget);
var actionXmlid = targetAction.data('action_xmlid');
if (actionXmlid) {
@@ -153,7 +153,7 @@ QUnit.test('activity menu widget: activity menu with 3 records', async function
});
QUnit.test('activity menu widget: activity view icon', async function (assert) {
assert.expect(10);
assert.expect(12);
var self = this;
var activityMenu = new ActivityMenu();
testUtils.mock.addMockEnvironment(activityMenu, {
@@ -193,9 +193,15 @@ QUnit.test('activity menu widget: activity view icon', async function (assert) {
// click on the "Issue" activity icon
await testUtils.dom.click(activityMenu.$('.dropdown-toggle'));
assert.hasClass(activityMenu.$('.dropdown-menu'), 'show',
"dropdown should be expanded");
await testUtils.dom.click(activityMenu.$(".o_mail_activity_action[data-model_name='Issue']"));
assert.doesNotHaveClass(activityMenu.$('.dropdown-menu'), 'show',
"dropdown should be collapsed");
// click on the "Note" activity icon
await testUtils.dom.click(activityMenu.$('.dropdown-toggle'));
await testUtils.dom.click(activityMenu.$(".o_mail_activity_action[data-model_name='Note']"));
assert.verifySteps([