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-05-26 15:20:24 -04:00
parent 113b487c37
commit 447eff16cd
10 changed files with 47 additions and 75 deletions

View file

@ -115,6 +115,12 @@
if (!this.id) {
this.id = 'select' + new Date().getTime();
}
this.removeEventListener('mousedown', onMouseDown);
this.removeEventListener('keydown', onKeyDown);
this.removeEventListener('focus', onFocus);
this.removeEventListener('blur', onBlur);
this.addEventListener('mousedown', onMouseDown);
this.addEventListener('keydown', onKeyDown);
this.addEventListener('focus', onFocus);
@ -123,17 +129,21 @@
EmbySelectPrototype.attachedCallback = function () {
var label = this.ownerDocument.createElement('label');
label.innerHTML = this.getAttribute('label') || '';
label.classList.add('selectLabel');
label.classList.add('selectLabelUnfocused');
label.htmlFor = this.id;
this.parentNode.insertBefore(label, this);
if (this.getAttribute('data-embyselect') != 'true') {
this.setAttribute('data-embyselect', 'true');
var div = document.createElement('div');
div.classList.add('emby-select-selectionbar');
div.innerHTML = '<div class="emby-select-selectionbarInner"></div>';
this.parentNode.insertBefore(div, this.nextSibling);
var label = this.ownerDocument.createElement('label');
label.innerHTML = this.getAttribute('label') || '';
label.classList.add('selectLabel');
label.classList.add('selectLabelUnfocused');
label.htmlFor = this.id;
this.parentNode.insertBefore(label, this);
var div = document.createElement('div');
div.classList.add('emby-select-selectionbar');
div.innerHTML = '<div class="emby-select-selectionbarInner"></div>';
this.parentNode.insertBefore(div, this.nextSibling);
}
};
document.registerElement('emby-select', {