From 4c46187ebfd19cb45b76684ae87e743e0701499e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 25 Jan 2013 11:05:47 +0100 Subject: [PATCH] [IMP] set_content_full_screen code, avoid duplications bzr revid: xmo@openerp.com-20130125100547-ujawyg4ohnrofl3u --- addons/web/static/src/js/chrome.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 91a006c1f7c..c346e9691b7 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1370,13 +1370,9 @@ instance.web.WebClient = instance.web.Client.extend({ }); }, set_content_full_screen: function(fullscreen) { - if (fullscreen) { - $(".oe_webclient", this.$el).addClass("oe_content_full_screen"); - $("body").css({'overflow-y':'hidden'}); - } else { - $(".oe_webclient", this.$el).removeClass("oe_content_full_screen"); - $("body").css({'overflow-y':'scroll'}); - } + $(document.body).css('overflow-y', fullscreen ? 'hidden' : 'scroll'); + this.$('.oe_webclient').toggleClass( + 'oe_content_full_screen', fullscreen); }, has_uncommitted_changes: function() { var $e = $.Event('clear_uncommitted_changes');