diff options
| author | Joren Van Onder <jov@odoo.com> | 2016-04-18 11:51:56 +0200 |
|---|---|---|
| committer | Joren Van Onder <jov@odoo.com> | 2016-04-19 08:53:10 +0200 |
| commit | 9fa53b7ee7fc8faca2ee8bc1d5205dca62f3e565 (patch) | |
| tree | 6212e239d1042f27b6063a4b977db7343a0cf371 /addons | |
| parent | 6057e645d6724692dbfc287fd650480f007d2028 (diff) | |
[FIX] point_of_sale: adapt to Chrome 50's new handling of cell heights
Chrome 50 treats percent-height divs inside of auto-height cells as
auto [1]. So from now on it's important that an explicit 'height: 100%' CSS
property is set on parent tds, otherwise you'll end up with elements
with a height of 0.
An extra difficulty is that this new height property on
subwindow-container will result in the element being as high as his
parent table. So the collapsed trick doesn't work anymore in the
customer list.
This has to be done conditionally. The proposed workaround of adding
100% height to parents of affected elements causes issues in IE/Edge
because the effect of adding a height in percent to a table-{cell,row}
element is not defined by CSS [2].
DO NOT FORWARD-PORT!
[1] https://chromium.googlesource.com/chromium/src/+/8876584335b48c99cf8df552ef4d8efebb131041
[2] http://stackoverflow.com/a/27384730
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/point_of_sale/static/src/css/chrome50.css | 6 | ||||
| -rw-r--r-- | addons/point_of_sale/static/src/css/pos.css | 3 | ||||
| -rw-r--r-- | addons/point_of_sale/static/src/js/widgets.js | 7 | ||||
| -rw-r--r-- | addons/point_of_sale/static/src/xml/pos.xml | 2 |
4 files changed, 17 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/css/chrome50.css b/addons/point_of_sale/static/src/css/chrome50.css new file mode 100644 index 00000000000..67ecddccfde --- /dev/null +++ b/addons/point_of_sale/static/src/css/chrome50.css @@ -0,0 +1,6 @@ +.pos .screen .content-cell{ + height: 100%; +} +.pos .subwindow .subwindow-container{ + height: 100%; +}
\ No newline at end of file diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 02b19831776..60337c78c15 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -166,6 +166,9 @@ td { .pos .window .subwindow.collapsed{ height: 0px; } +.pos .window .subwindow-container .collapsed{ + height: 0px; +} .pos .subwindow .subwindow-container{ display: table-cell; position: relative; diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 59decb450ac..81cd422a737 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -965,6 +965,13 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa start: function() { var self = this; return self.pos.ready.done(function() { + if ($.browser.chrome) { + var chrome_version = $.browser.version.split('.')[0]; + if (parseInt(chrome_version, 10) >= 50) { + openerp.loadCSS('/point_of_sale/static/src/css/chrome50.css'); + } + } + // remove default webclient handlers that induce click delay $(document).off(); $(window).off(); diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 34d81e9475b..196495dd624 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -435,7 +435,7 @@ <section class="full-content"> <div class='window'> <section class='subwindow collapsed'> - <div class='subwindow-container'> + <div class='subwindow-container collapsed'> <div class='subwindow-container-fix client-details-contents'> </div> </div> |
