[IMP] adjust web client height with announcement bar
authorGéry Debongnie <ged@odoo.com>
Thu, 28 Aug 2014 09:49:17 +0000 (11:49 +0200)
committerGéry Debongnie <ged@odoo.com>
Thu, 28 Aug 2014 13:22:31 +0000 (15:22 +0200)
when the user is not registered, the announcement bar messed up the
layout by adding a third scrollbar.  This commit fixes the issue by
ajusting the height if necessary.  The timeout is necessary to prevent
a scrollbar from appearing when the animation is running.

addons/mail/static/src/js/announcement.js

index 95d4dc6..60c0fde 100644 (file)
@@ -31,12 +31,16 @@ openerp_announcement = function(instance) {
                     var close = function() {
                         var ttl = 7*24*60*60;
                         self.session.set_cookie('ab', 'c', ttl);
-                        $bar.slideUp('slow');
+                        $bar.slideUp();
+                        setTimeout(function () {
+                            $('.openerp_webclient_container').css('height', 'calc(100% - 34px)');                            
+                        }, 400);
                     };
                     $bar.find('.close').on('click', close);
                     self.trigger('ab_loaded', $bar);
                 });
 
+                $('.openerp_webclient_container').css('height', 'calc(100% - 64px)');
                 $('head').append($css);
             });
         }