mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
823f69bb92
commit
db0bac5a2b
22 changed files with 113 additions and 91 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue