From 49c46b0bb47fcf459b0e8d72c7593e860b9bbbc4 Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Thu, 20 Feb 2020 11:01:24 +0000 Subject: [PATCH] [FIX] mail: activity popup is outside the screen Before this commit, the popup activity in kanban was rendered using the position of the button. So the left popup was nearly in the center of the screen but the width is too large to be contained on the screen. After this commit, in mobile, the popup activity in kanban will be placed on the left of the button to avoid to go outside of the viewport. Steps to reproduce: * Go to sale app (in mobile) * Click on the activity button of a kanban card (clock icon) BUG Task ID: 2198429 closes odoo/odoo#45860 X-original-commit: 392c8a57df798d92b8be73d743b690891cf2fda2 Signed-off-by: Pierre Paridans --- addons/mail/static/src/js/activity.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/activity.js b/addons/mail/static/src/js/activity.js index 5596e407c09..07c60f513b8 100644 --- a/addons/mail/static/src/js/activity.js +++ b/addons/mail/static/src/js/activity.js @@ -5,6 +5,7 @@ var mailUtils = require('mail.utils'); var AbstractField = require('web.AbstractField'); var BasicModel = require('web.BasicModel'); +var config = require('web.config'); var core = require('web.core'); var field_registry = require('web.field_registry'); var session = require('web.session'); @@ -711,7 +712,9 @@ var KanbanActivity = BasicActivity.extend({ */ _renderDropdown: function () { var self = this; - this.$('.o_activity').html(QWeb.render('mail.KanbanActivityLoading')); + this.$('.o_activity') + .toggleClass('dropdown-menu-right', config.device.isMobile) + .html(QWeb.render('mail.KanbanActivityLoading')); return _readActivities(this, this.value.res_ids).then(function (activities) { activities = setFileUploadID(activities); self.$('.o_activity').html(QWeb.render('mail.KanbanActivityDropdown', {