run prettier on modified V4.js

This commit is contained in:
Brian Hicks 2022-05-26 16:04:15 -05:00
parent 5e63619042
commit e262018e10
No known key found for this signature in database
GPG Key ID: C4F324B9CAAB0D50

View File

@ -32,32 +32,36 @@ CustomElement.create({
} }
}, },
_resize: function() { _resize: function () {
var minHeight = null; var minHeight = null;
var computedStyles = window.getComputedStyle(this._textarea); var computedStyles = window.getComputedStyle(this._textarea);
if (this._textarea.style.minHeight) { if (this._textarea.style.minHeight) {
minHeight = parseInt(this._textarea.style.minHeight, 10); minHeight = parseInt(this._textarea.style.minHeight, 10);
} else { } else {
minHeight = parseInt(computedStyles.minHeight, 10) minHeight = parseInt(computedStyles.minHeight, 10);
}
if (minHeight === 0) {
minHeight = parseInt(computedStyles.height, 10)
} }
this._textarea.style.overflowY = 'hidden' if (minHeight === 0) {
this._textarea.style.minHeight = minHeight + 'px' minHeight = parseInt(computedStyles.height, 10);
this._textarea.style.transition = 'none' }
this._textarea.style.overflowY = "hidden";
this._textarea.style.minHeight = minHeight + "px";
this._textarea.style.transition = "none";
// the browser does not include border widths in `.scrollHeight`, but we // the browser does not include border widths in `.scrollHeight`, but we
// sometimes use `box-sizing: border-box` on these elements so we need to // sometimes use `box-sizing: border-box` on these elements so we need to
// take it into account when setting the CSS `height`. // take it into account when setting the CSS `height`.
var borderOffset = 0; var borderOffset = 0;
if (computedStyles.boxSizing === 'border-box') { if (computedStyles.boxSizing === "border-box") {
borderOffset = parseInt(computedStyles.borderTopWidth, 10) + parseInt(computedStyles.borderBottomWidth, 10); borderOffset =
parseInt(computedStyles.borderTopWidth, 10) +
parseInt(computedStyles.borderBottomWidth, 10);
} }
this._textarea.style.height = Math.max(minHeight, this._textarea.scrollHeight + borderOffset) + 'px' this._textarea.style.height =
} Math.max(minHeight, this._textarea.scrollHeight + borderOffset) + "px";
} },
}) },
});