1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-08-02 21:32:16 -04:00
parent 823f69bb92
commit db0bac5a2b
22 changed files with 113 additions and 91 deletions

View file

@ -101,12 +101,12 @@
EmbyTextAreaPrototype.attachedCallback = function () {
if (this.getAttribute('data-embytextarea') == 'true') {
if (this.classList.contains('emby-textarea')) {
return;
}
this.rows = 1;
this.setAttribute('data-embytextarea', 'true');
this.classList.add('emby-textarea');
var parentNode = this.parentNode;
var label = this.ownerDocument.createElement('label');
@ -124,29 +124,15 @@
div.classList.add('emby-textarea-selectionbar');
parentNode.insertBefore(div, this.nextSibling);
function onChange() {
if (this.value) {
label.classList.remove('blank');
} else {
label.classList.add('blank');
}
}
this.addEventListener('focus', function () {
onChange.call(this);
label.classList.add('focused');
label.classList.add('textareaLabelFocused');
label.classList.remove('textareaLabelUnfocused');
});
this.addEventListener('blur', function () {
onChange.call(this);
label.classList.remove('focused');
label.classList.remove('textareaLabelFocused');
label.classList.add('textareaLabelUnfocused');
});
this.addEventListener('change', onChange);
this.addEventListener('input', onChange);
this.addEventListener('valueset', onChange);
onChange.call(this);
this.label = function (text) {
label.innerHTML = text;
};