mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-20 04:18:19 -07:00
replace require with Dynamic Imports
This commit is contained in:
parent
eff468dc82
commit
cf1ca53f9c
@ -93,8 +93,7 @@ export class editor {
|
||||
constructor() {
|
||||
this.show = (itemType, options, availableOptions) => {
|
||||
return new Promise((resolve) => {
|
||||
//TODO: remove require
|
||||
require(['text!./components/imageOptionsEditor/imageOptionsEditor.template.html'], template => {
|
||||
import('text!./components/imageOptionsEditor/imageOptionsEditor.template.html').then(({default: template}) => {
|
||||
const dlg = dialogHelper.createDialog({
|
||||
size: 'small',
|
||||
removeOnClose: true,
|
||||
|
@ -268,8 +268,8 @@ import 'emby-input';
|
||||
return true;
|
||||
}
|
||||
|
||||
function populateMetadataSettings(parent, contentType, isNewLibrary) {
|
||||
isNewLibrary = parent.classList.contains('newlibrary');
|
||||
function populateMetadataSettings(parent, contentType) {
|
||||
const isNewLibrary = parent.classList.contains('newlibrary');
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Libraries/AvailableOptions', {
|
||||
LibraryContentType: contentType,
|
||||
IsNewLibrary: isNewLibrary
|
||||
@ -365,8 +365,7 @@ import 'emby-input';
|
||||
const isNewLibrary = null === libraryOptions;
|
||||
isNewLibrary && parent.classList.add('newlibrary');
|
||||
return new Promise((resolve) => {
|
||||
//TODO: remove require
|
||||
require(['text!./components/libraryoptionseditor/libraryoptionseditor.template.html'], function (template) {
|
||||
import('text!./libraryoptionseditor.template.html').then(({default: template}) => {
|
||||
parent.innerHTML = globalize.translateDocument(template);
|
||||
populateRefreshInterval(parent.querySelector('#selectAutoRefreshInterval'));
|
||||
const promises = [populateLanguages(parent), populateCountries(parent.querySelector('#selectCountry'))];
|
||||
|
Loading…
Reference in New Issue
Block a user