diff options
| author | Julien Legros <jle@odoo.com> | 2016-01-19 11:37:27 +0100 |
|---|---|---|
| committer | Julien Legros <jle@odoo.com> | 2016-01-19 11:37:27 +0100 |
| commit | ddcc62c6dd0a73a04c9f5f2078ecd338c0e146bb (patch) | |
| tree | ff0837e802390cc9333fe306466a2e1f8b431641 /addons/web/static/src/js/framework | |
| parent | 85b3e96396b411a0b66863ddf6af854e22071e6f (diff) | |
| parent | 365e298fb1907085d4071285c2be5dbcd5c59a0e (diff) | |
[MERGE] forward port of branch 9.0 up to 365e298
Diffstat (limited to 'addons/web/static/src/js/framework')
| -rw-r--r-- | addons/web/static/src/js/framework/utils.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/web/static/src/js/framework/utils.js b/addons/web/static/src/js/framework/utils.js index 38953138da9..a0ab37a7dfb 100644 --- a/addons/web/static/src/js/framework/utils.js +++ b/addons/web/static/src/js/framework/utils.js @@ -475,10 +475,16 @@ function autoresize ($textarea, options) { top: -10000, left: -10000, }); - $fixed_text_area.addClass($fixed_text_area[0].classList); + $fixed_text_area.addClass($textarea[0].className); $fixed_text_area.insertAfter($textarea); } + var style = window.getComputedStyle($textarea[0], null); + if (style.resize === 'vertical') { + $textarea[0].style.resize = 'none'; + } else if (style.resize === 'both') { + $textarea[0].style.resize = 'horizontal'; + } resize(); if ($textarea.__auto_resized) { return; @@ -499,7 +505,7 @@ function autoresize ($textarea, options) { } else { heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); } - $fixed_text_area.width($textarea.outerWidth()); + $fixed_text_area.width($textarea.width()); $fixed_text_area.val($textarea.val()); var height = $fixed_text_area[0].scrollHeight; $textarea.css({height: Math.max(height + heightOffset, min_height)}); |
