mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-23 08:27:11 +03:00
run prettier on modified V4.js
This commit is contained in:
parent
5e63619042
commit
e262018e10
@ -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";
|
||||||
}
|
},
|
||||||
})
|
},
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user