1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #1726 from matjaz321/migrated-livetvseriestimers-to-es6-module

Migrated livetvseriestimer to es6 module
This commit is contained in:
dkanada 2020-08-06 01:26:44 +09:00 committed by GitHub
commit 11c90cdcaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 45 deletions

View file

@ -224,6 +224,7 @@
"src/controllers/livetvstatus.js", "src/controllers/livetvstatus.js",
"src/controllers/livetvguideprovider.js", "src/controllers/livetvguideprovider.js",
"src/controllers/livetvsettings.js", "src/controllers/livetvsettings.js",
"src/controllers/livetv/livetvseriestimers.js",
"src/controllers/livetv/livetvchannels.js", "src/controllers/livetv/livetvchannels.js",
"src/controllers/shows/episodes.js", "src/controllers/shows/episodes.js",
"src/controllers/shows/tvgenres.js", "src/controllers/shows/tvgenres.js",

View file

@ -1,11 +1,11 @@
define(['datetime', 'cardBuilder', 'imageLoader', 'apphost', 'loading', 'paper-icon-button-light', 'emby-button'], function (datetime, cardBuilder, imageLoader, appHost, loading) { import cardBuilder from 'cardBuilder';
'use strict'; import imageLoader from 'imageLoader';
import loading from 'loading';
import 'paper-icon-button-light';
import 'emby-button';
loading = loading.default || loading; function renderTimers(context, timers) {
const html = cardBuilder.getCardsHtml({
function renderTimers(context, timers) {
var html = '';
html += cardBuilder.getCardsHtml({
items: timers, items: timers,
shape: 'auto', shape: 'auto',
defaultShape: 'portrait', defaultShape: 'portrait',
@ -20,26 +20,27 @@ define(['datetime', 'cardBuilder', 'imageLoader', 'apphost', 'loading', 'paper-i
overlayMoreButton: true, overlayMoreButton: true,
lines: 3 lines: 3
}); });
var elem = context.querySelector('#items'); const elem = context.querySelector('#items');
elem.innerHTML = html; elem.innerHTML = html;
imageLoader.lazyChildren(elem); imageLoader.lazyChildren(elem);
loading.hide(); loading.hide();
} }
function reload(context, promise) { function reload(context, promise) {
loading.show(); loading.show();
promise.then(function (result) { promise.then(function (result) {
renderTimers(context, result.Items); renderTimers(context, result.Items);
}); });
} }
var query = { const query = {
SortBy: 'SortName', SortBy: 'SortName',
SortOrder: 'Ascending' SortOrder: 'Ascending'
}; };
return function (view, params, tabContent) {
var timersPromise; export default function (view, params, tabContent) {
var self = this; let timersPromise;
const self = this;
self.preRender = function () { self.preRender = function () {
timersPromise = ApiClient.getLiveTvSeriesTimers(query); timersPromise = ApiClient.getLiveTvSeriesTimers(query);
@ -48,5 +49,4 @@ define(['datetime', 'cardBuilder', 'imageLoader', 'apphost', 'loading', 'paper-i
self.renderTab = function () { self.renderTab = function () {
reload(tabContent, timersPromise); reload(tabContent, timersPromise);
}; };
}; }
});