refactor: move extracted function above eslint comment

This commit is contained in:
Aimekram 2022-10-19 22:17:32 +02:00
parent 8251b65399
commit 85e18c86d8

View file

@ -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;