update var declerations
This commit is contained in:
parent
8d17c6fc6f
commit
85b8671294
3 changed files with 28 additions and 28 deletions
|
@ -7,7 +7,7 @@ import 'emby-input';
|
|||
/* eslint-disable indent */
|
||||
|
||||
function autoGrow(textarea, maxLines) {
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
if (maxLines === undefined) {
|
||||
maxLines = 999;
|
||||
|
@ -19,17 +19,17 @@ import 'emby-input';
|
|||
* @returns {number}
|
||||
*/
|
||||
self.getOffset = function (textarea) {
|
||||
var style = window.getComputedStyle(textarea, null);
|
||||
var props = ['paddingTop', 'paddingBottom'];
|
||||
var offset = 0;
|
||||
const style = window.getComputedStyle(textarea, null);
|
||||
const props = ['paddingTop', 'paddingBottom'];
|
||||
let offset = 0;
|
||||
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
for (let i = 0; i < props.length; i++) {
|
||||
offset += parseInt(style[props[i]]);
|
||||
}
|
||||
return offset;
|
||||
};
|
||||
|
||||
var offset;
|
||||
let offset;
|
||||
function reset() {
|
||||
textarea.rows = 1;
|
||||
offset = self.getOffset(textarea);
|
||||
|
@ -48,8 +48,8 @@ import 'emby-input';
|
|||
textarea.rows = 3;
|
||||
return;
|
||||
}
|
||||
var newHeight = 0;
|
||||
var hasGrown = false;
|
||||
let newHeight = 0;
|
||||
let hasGrown = false;
|
||||
|
||||
if ((textarea.scrollHeight - offset) > self.maxAllowedHeight) {
|
||||
textarea.style.overflowY = 'scroll';
|
||||
|
@ -72,17 +72,17 @@ import 'emby-input';
|
|||
autogrowFn();
|
||||
}
|
||||
|
||||
var EmbyTextAreaPrototype = Object.create(HTMLTextAreaElement.prototype);
|
||||
const EmbyTextAreaPrototype = Object.create(HTMLTextAreaElement.prototype);
|
||||
|
||||
var elementId = 0;
|
||||
let elementId = 0;
|
||||
|
||||
if (Object.getOwnPropertyDescriptor && Object.defineProperty) {
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
||||
const descriptor = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
||||
|
||||
// descriptor returning null in webos
|
||||
if (descriptor && descriptor.configurable) {
|
||||
var baseSetMethod = descriptor.set;
|
||||
const baseSetMethod = descriptor.set;
|
||||
descriptor.set = function (value) {
|
||||
baseSetMethod.call(this, value);
|
||||
|
||||
|
@ -113,8 +113,8 @@ import 'emby-input';
|
|||
this.rows = 1;
|
||||
this.classList.add('emby-textarea');
|
||||
|
||||
var parentNode = this.parentNode;
|
||||
var label = this.ownerDocument.createElement('label');
|
||||
const parentNode = this.parentNode;
|
||||
const label = this.ownerDocument.createElement('label');
|
||||
label.innerHTML = this.getAttribute('label') || '';
|
||||
label.classList.add('textareaLabel');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue