refactor: move extracted function above eslint comment
This commit is contained in:
parent
8251b65399
commit
85e18c86d8
1 changed files with 9 additions and 10 deletions
|
@ -2,19 +2,18 @@ import './emby-textarea.scss';
|
||||||
import 'webcomponents.js/webcomponents-lite';
|
import 'webcomponents.js/webcomponents-lite';
|
||||||
import '../emby-input/emby-input';
|
import '../emby-input/emby-input';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
function calculateOffset(textarea) {
|
||||||
|
const style = window.getComputedStyle(textarea, null);
|
||||||
|
const props = ['paddingTop', 'paddingBottom'];
|
||||||
|
let offset = 0;
|
||||||
|
|
||||||
function calculateOffset(textarea) {
|
for (let i = 0; i < props.length; i++) {
|
||||||
const style = window.getComputedStyle(textarea, null);
|
offset += parseInt(style[props[i]]);
|
||||||
const props = ['paddingTop', 'paddingBottom'];
|
|
||||||
let offset = 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < props.length; i++) {
|
|
||||||
offset += parseInt(style[props[i]]);
|
|
||||||
}
|
|
||||||
return offset;
|
|
||||||
}
|
}
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* eslint-disable indent */
|
||||||
function autoGrow(textarea, maxLines) {
|
function autoGrow(textarea, maxLines) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue