summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/core/dom.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js
index 7e3cb6128b9..eaff2185de9 100644
--- a/addons/web/static/src/js/core/dom.js
+++ b/addons/web/static/src/js/core/dom.js
@@ -74,12 +74,12 @@ return {
function resize() {
$fixedTextarea.insertAfter($textarea);
- var heightOffset;
+ var heightOffset = 0;
var style = window.getComputedStyle($textarea[0], null);
- if (style.boxSizing === 'content-box') {
- heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
- } else {
- heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
+ if (style.boxSizing === 'border-box') {
+ var paddingHeight = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
+ var borderHeight = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
+ heightOffset = borderHeight + paddingHeight;
}
$fixedTextarea.width($textarea.width());
$fixedTextarea.val($textarea.val());