use import for ItemsByName & PlaylistViewer

This commit is contained in:
grafixeyehero 2022-05-04 03:36:40 +03:00 committed by Bill Thornton
parent 6d3365bc09
commit ac62a5e8bf
4 changed files with 19 additions and 14 deletions

View File

@ -215,7 +215,6 @@ module.exports = {
'LiveTvHelpers': 'writable',
'Loading': 'writable',
'MetadataEditor': 'writable',
'PlaylistViewer': 'writable',
'ServerNotifications': 'writable',
'TaskButton': 'writable',
'UserParentalControlPage': 'writable',

View File

@ -1507,13 +1507,13 @@ function renderChildren(page, item) {
}
function renderItemsByName(page, item) {
import('../../scripts/itembynamedetailpage').then(() => {
window.ItemsByName.renderItems(page, item);
import('../../scripts/itembynamedetailpage').then(({ default: ItemsByName }) => {
ItemsByName.renderItems(page, item);
});
}
function renderPlaylistItems(page, item) {
import('../../scripts/playlistedit').then(() => {
import('../../scripts/playlistViewer').then(({ default: PlaylistViewer }) => {
PlaylistViewer.render(page, item);
});
}

View File

@ -373,6 +373,8 @@ function getItemsFunction(options, item) {
};
}
window.ItemsByName = {
const ItemsByName = {
renderItems: renderItems
};
export default ItemsByName;

View File

@ -35,14 +35,18 @@ function init(page, item) {
elem.getItemsHtml = getItemsHtmlFn(item.Id);
}
window.PlaylistViewer = {
render: function (page, item) {
if (!page.playlistInit) {
page.playlistInit = true;
init(page, item);
}
page.querySelector('#childrenContent').classList.add('verticalSection-extrabottompadding');
page.querySelector('#childrenContent .itemsContainer').refreshItems();
function render(page, item) {
if (!page.playlistInit) {
page.playlistInit = true;
init(page, item);
}
page.querySelector('#childrenContent').classList.add('verticalSection-extrabottompadding');
page.querySelector('#childrenContent .itemsContainer').refreshItems();
}
const PlaylistViewer = {
render: render
};
export default PlaylistViewer;