summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/announcement.js16
-rw-r--r--addons/mail/static/src/js/mail.js6
2 files changed, 14 insertions, 8 deletions
diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js
index 7afb25a7da0..d85e8c9b5af 100644
--- a/addons/mail/static/src/js/announcement.js
+++ b/addons/mail/static/src/js/announcement.js
@@ -36,11 +36,17 @@ openerp_announcement = function(instance) {
$('.openerp_webclient_container').css('height', 'calc(100% - 34px)');
}, 400);
};
- var height = $('#announcement_bar_table').outerHeight()
- + $('#oe_main_menu_navbar').outerHeight();
- $('.openerp_webclient_container').css('height', 'calc(100% - ' + height + 'px)');
- $bar.find('.close').on('click', close);
- self.trigger('ab_loaded', $bar);
+ /*
+ We need a timeout of at least 350ms because the announcement bar appears
+ with an animation of 350ms and the computed height might be wrong if we don't wait
+ */
+ setTimeout(function(){
+ var height = $('#announcement_bar_table').outerHeight()
+ + $('#oe_main_menu_navbar').outerHeight();
+ $('.openerp_webclient_container').css('height', 'calc(100% - ' + height + 'px)');
+ $bar.find('.close').on('click', close);
+ self.trigger('ab_loaded', $bar);
+ }, 400)
});
$('head').append($css);
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index fc4f498ad94..a42bc417683 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -880,7 +880,7 @@ openerp.mail = function (session) {
self.parent_thread.message_fetch(this.domain, this.context, false, function (arg, data) {
self.id = false;
// insert the message on dom after this message
- self.parent_thread.switch_new_message( data, self.$el );
+ self.parent_thread.switch_new_message( data, self.$el.parent() );
self.animated_destroy(200);
});
@@ -1021,8 +1021,8 @@ openerp.mail = function (session) {
on_expand: function (event) {
event.stopPropagation();
- this.$('.oe_msg_body_short:first').toggle();
- this.$('.oe_msg_body_long:first').toggle();
+ this.$('.oe_msg_body:first > .oe_msg_body_short:first').toggle();
+ this.$('.oe_msg_body:first > .oe_msg_body_long:first').toggle();
return false;
},