mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove duplicate card shape functions
This commit is contained in:
parent
4cbff9dbd7
commit
1e3fa5418c
16 changed files with 294 additions and 339 deletions
|
@ -1,10 +1,12 @@
|
|||
import loading from '../../components/loading/loading';
|
||||
import cardBuilder from '../../components/cardbuilder/cardBuilder';
|
||||
import imageLoader from '../../components/images/imageLoader';
|
||||
import '../../scripts/livetvcomponents';
|
||||
import '../../components/listview/listview.scss';
|
||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import Dashboard from '../../utils/dashboard';
|
||||
import cardBuilder from 'components/cardbuilder/cardBuilder';
|
||||
import imageLoader from 'components/images/imageLoader';
|
||||
import loading from 'components/loading/loading';
|
||||
import { getBackdropShape } from 'utils/card';
|
||||
import Dashboard from 'utils/dashboard';
|
||||
|
||||
import 'scripts/livetvcomponents';
|
||||
import 'components/listview/listview.scss';
|
||||
import 'elements/emby-itemscontainer/emby-itemscontainer';
|
||||
|
||||
function renderRecordings(elem, recordings, cardOptions, scrollX) {
|
||||
if (!elem) {
|
||||
|
@ -32,7 +34,7 @@ function renderRecordings(elem, recordings, cardOptions, scrollX) {
|
|||
recordingItems.innerHTML = cardBuilder.getCardsHtml(Object.assign({
|
||||
items: recordings,
|
||||
shape: scrollX ? 'autooverflow' : 'auto',
|
||||
defaultShape: scrollX ? 'overflowBackdrop' : 'backdrop',
|
||||
defaultShape: getBackdropShape(scrollX),
|
||||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
coverImage: true,
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import layoutManager from '../../components/layoutManager';
|
||||
import cardBuilder from '../../components/cardbuilder/cardBuilder';
|
||||
import imageLoader from '../../components/images/imageLoader';
|
||||
import loading from '../../components/loading/loading';
|
||||
import '../../scripts/livetvcomponents';
|
||||
import '../../elements/emby-button/emby-button';
|
||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import Dashboard from '../../utils/dashboard';
|
||||
import cardBuilder from 'components/cardbuilder/cardBuilder';
|
||||
import imageLoader from 'components/images/imageLoader';
|
||||
import layoutManager from 'components/layoutManager';
|
||||
import loading from 'components/loading/loading';
|
||||
import { getBackdropShape } from 'utils/card';
|
||||
import Dashboard from 'utils/dashboard';
|
||||
|
||||
import 'elements/emby-button/emby-button';
|
||||
import 'elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import 'scripts/livetvcomponents';
|
||||
|
||||
function enableScrollX() {
|
||||
return !layoutManager.desktop;
|
||||
|
@ -50,15 +52,11 @@ function renderRecordings(elem, recordings, cardOptions) {
|
|||
imageLoader.lazyChildren(recordingItems);
|
||||
}
|
||||
|
||||
function getBackdropShape() {
|
||||
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
|
||||
}
|
||||
|
||||
function renderActiveRecordings(context, promise) {
|
||||
promise.then(function (result) {
|
||||
renderRecordings(context.querySelector('#activeRecordings'), result.Items, {
|
||||
shape: enableScrollX() ? 'autooverflow' : 'auto',
|
||||
defaultShape: getBackdropShape(),
|
||||
defaultShape: getBackdropShape(enableScrollX()),
|
||||
showParentTitle: false,
|
||||
showParentTitleOrTitle: true,
|
||||
showTitle: true,
|
||||
|
|
|
@ -1,36 +1,25 @@
|
|||
import layoutManager from '../../components/layoutManager';
|
||||
import * as userSettings from '../../scripts/settings/userSettings';
|
||||
import inputManager from '../../scripts/inputManager';
|
||||
import loading from '../../components/loading/loading';
|
||||
import globalize from '../../scripts/globalize';
|
||||
import * as mainTabsManager from '../../components/maintabsmanager';
|
||||
import cardBuilder from '../../components/cardbuilder/cardBuilder';
|
||||
import imageLoader from '../../components/images/imageLoader';
|
||||
import '../../styles/scrollstyles.scss';
|
||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import '../../elements/emby-tabs/emby-tabs';
|
||||
import '../../elements/emby-button/emby-button';
|
||||
import { LibraryTab } from '../../types/libraryTab.ts';
|
||||
import Dashboard from '../../utils/dashboard';
|
||||
import cardBuilder from 'components/cardbuilder/cardBuilder';
|
||||
import imageLoader from 'components/images/imageLoader';
|
||||
import layoutManager from 'components/layoutManager';
|
||||
import loading from 'components/loading/loading';
|
||||
import * as mainTabsManager from 'components/maintabsmanager';
|
||||
import globalize from 'scripts/globalize';
|
||||
import inputManager from 'scripts/inputManager';
|
||||
import * as userSettings from 'scripts/settings/userSettings';
|
||||
import { LibraryTab } from 'types/libraryTab';
|
||||
import Dashboard from 'utils/dashboard';
|
||||
import { getBackdropShape, getPortraitShape } from 'utils/card';
|
||||
|
||||
import 'elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import 'elements/emby-tabs/emby-tabs';
|
||||
import 'elements/emby-button/emby-button';
|
||||
|
||||
import 'styles/scrollstyles.scss';
|
||||
|
||||
function enableScrollX() {
|
||||
return !layoutManager.desktop;
|
||||
}
|
||||
|
||||
function getBackdropShape() {
|
||||
if (enableScrollX()) {
|
||||
return 'overflowBackdrop';
|
||||
}
|
||||
return 'backdrop';
|
||||
}
|
||||
|
||||
function getPortraitShape() {
|
||||
if (enableScrollX()) {
|
||||
return 'overflowPortrait';
|
||||
}
|
||||
return 'portrait';
|
||||
}
|
||||
|
||||
function getLimit() {
|
||||
if (enableScrollX()) {
|
||||
return 12;
|
||||
|
@ -96,7 +85,7 @@ function reload(page, enableFullRender) {
|
|||
EnableImageTypes: 'Primary,Thumb'
|
||||
}).then(function (result) {
|
||||
renderItems(page, result.Items, 'upcomingTvMovieItems', null, {
|
||||
shape: getPortraitShape(),
|
||||
shape: getPortraitShape(enableScrollX()),
|
||||
preferThumb: null,
|
||||
showParentTitle: false
|
||||
});
|
||||
|
@ -147,7 +136,7 @@ function renderItems(page, items, sectionClass, overlayButton, cardOptions) {
|
|||
preferThumb: 'auto',
|
||||
inheritThumb: false,
|
||||
shape: enableScrollX() ? 'autooverflow' : 'auto',
|
||||
defaultShape: getBackdropShape(),
|
||||
defaultShape: getBackdropShape(enableScrollX()),
|
||||
showParentTitle: true,
|
||||
showTitle: true,
|
||||
centerText: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue