mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Dynamic generate selectPersonType Options
This commit is contained in:
parent
7102b17dc0
commit
67f5eb4487
2 changed files with 11 additions and 27 deletions
|
@ -2,6 +2,7 @@
|
||||||
import dialogHelper from '../dialogHelper/dialogHelper';
|
import dialogHelper from '../dialogHelper/dialogHelper';
|
||||||
import layoutManager from '../layoutManager';
|
import layoutManager from '../layoutManager';
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
|
import { PersonKind } from '@jellyfin/sdk/lib/generated-client';
|
||||||
import '../../elements/emby-button/paper-icon-button-light';
|
import '../../elements/emby-button/paper-icon-button-light';
|
||||||
import '../../elements/emby-input/emby-input';
|
import '../../elements/emby-input/emby-input';
|
||||||
import '../../elements/emby-select/emby-select';
|
import '../../elements/emby-select/emby-select';
|
||||||
|
@ -61,6 +62,15 @@ function show(person) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let selectPersonTypeOptions = '<option value=""></option>';
|
||||||
|
for (const type of Object.values(PersonKind)) {
|
||||||
|
if (type === PersonKind.Unknown) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
selectPersonTypeOptions += `<option value="${type}">\${${type}}</option>`;
|
||||||
|
}
|
||||||
|
dlg.querySelector('.selectPersonType').innerHTML = globalize.translateHtml(selectPersonTypeOptions);
|
||||||
|
|
||||||
dlg.querySelector('.selectPersonType').addEventListener('change', function () {
|
dlg.querySelector('.selectPersonType').addEventListener('change', function () {
|
||||||
if (this.value === 'Actor') {
|
if (this.value === 'Actor') {
|
||||||
dlg.querySelector('.fldRole').classList.remove('hide');
|
dlg.querySelector('.fldRole').classList.remove('hide');
|
||||||
|
|
|
@ -12,33 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="selectContainer">
|
<div class="selectContainer">
|
||||||
<select is="emby-select" id="selectPersonType" class="selectPersonType" label="${LabelType}">
|
<select is="emby-select" id="selectPersonType" class="selectPersonType" label="${LabelType}"></select>
|
||||||
<option value=""></option>
|
|
||||||
<option value="Actor">${Actor}</option>
|
|
||||||
<option value="Composer">${Composer}</option>
|
|
||||||
<option value="Director">${Director}</option>
|
|
||||||
<option value="GuestStar">${GuestStar}</option>
|
|
||||||
<option value="Producer">${Producer}</option>
|
|
||||||
<option value="Writer">${Writer}</option>
|
|
||||||
<option value="Conductor">${Conductor}</option>
|
|
||||||
<option value="Lyricist">${Lyricist}</option>
|
|
||||||
<option value="Arranger">${Arranger}</option>
|
|
||||||
<option value="Engineer">${Engineer}</option>
|
|
||||||
<option value="Mixer">${Mixer}</option>
|
|
||||||
<option value="Remixer">${Remixer}</option>
|
|
||||||
<option value="AlbumArtist">${AlbumArtist}</option>
|
|
||||||
<option value="Artist">${Artist}</option>
|
|
||||||
<option value="Creator">${Creator}</option>
|
|
||||||
<option value="Author">${Author}</option>
|
|
||||||
<option value="Illustrator">${Illustrator}</option>
|
|
||||||
<option value="Penciller">${Penciller}</option>
|
|
||||||
<option value="Inker">${Inker}</option>
|
|
||||||
<option value="Colorist">${Colorist}</option>
|
|
||||||
<option value="Letterer">${Letterer}</option>
|
|
||||||
<option value="CoverArtist">${CoverArtist}</option>
|
|
||||||
<option value="Editor">${Editor}</option>
|
|
||||||
<option value="Translator">${Translator}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inputContainer fldRole hide">
|
<div class="inputContainer fldRole hide">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue