From b49524e5eaa87f2584c0e189d78e0069829a1987 Mon Sep 17 00:00:00 2001 From: vitorsemeano Date: Sat, 7 Nov 2020 12:05:09 +0000 Subject: [PATCH] multiple fixes and otimizations --- src/components/dialog/dialog.js | 3 +-- src/components/scrollManager.js | 2 +- src/components/shortcuts.js | 3 +-- src/components/userdatabuttons/userdatabuttons.js | 4 ++-- src/elements/emby-itemscontainer/emby-itemscontainer.js | 5 ++--- src/elements/emby-select/emby-select.js | 1 - src/scripts/clientUtils.js | 4 ++-- src/scripts/globalize.js | 2 -- src/scripts/libraryMenu.js | 2 -- src/scripts/mouseManager.js | 1 - 10 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/components/dialog/dialog.js b/src/components/dialog/dialog.js index 530b0f43fb..ee97fff8a1 100644 --- a/src/components/dialog/dialog.js +++ b/src/components/dialog/dialog.js @@ -80,8 +80,7 @@ import '../../assets/css/flexstyles.scss'; buttonClass += ' formDialogFooterItem-vertical formDialogFooterItem-nomarginbottom'; } - html += ``; + html += ``; if (item.description) { html += `
${item.description}
`; diff --git a/src/components/scrollManager.js b/src/components/scrollManager.js index 51a718476a..a11f1448eb 100644 --- a/src/components/scrollManager.js +++ b/src/components/scrollManager.js @@ -223,7 +223,7 @@ import layoutManager from './layoutManager'; let parent = element.parentElement; while (parent) { - // Skip '../../elements/emby-scroller/emby-scroller' because it scrolls by itself + // Skip 'emby-scroller' because it scrolls by itself if (!parent.classList.contains('emby-scroller') && parent[nameScroll] > parent[nameClient] && parent.classList.contains(nameClass)) { return parent; diff --git a/src/components/shortcuts.js b/src/components/shortcuts.js index a24ef5d079..5c2e205398 100644 --- a/src/components/shortcuts.js +++ b/src/components/shortcuts.js @@ -71,8 +71,7 @@ import toast from './toast/toast'; } function showProgramDialog(item) { - import('./recordingcreator/recordingcreator' + - '').then(({default:recordingCreator}) => { + import('./recordingcreator/recordingcreator').then(({default:recordingCreator}) => { recordingCreator.show(item.Id, item.ServerId); }); } diff --git a/src/components/userdatabuttons/userdatabuttons.js b/src/components/userdatabuttons/userdatabuttons.js index 924c0cf09c..9fe5546fcb 100644 --- a/src/components/userdatabuttons/userdatabuttons.js +++ b/src/components/userdatabuttons/userdatabuttons.js @@ -20,7 +20,7 @@ function getUserDataButtonHtml(method, itemId, serverId, buttonCssClass, iconCss buttonCssClass = buttonCssClass ? (buttonCssClass + ' mini') : 'mini'; } - const is = style === 'fab' ? '../../elements/emby-button/emby-button' : '../../elements/emby-button/paper-icon-button-light'; + const is = style === 'fab' ? 'emby-button' : 'paper-icon-button-light'; let className = style === 'fab' ? 'autoSize fab' : 'autoSize'; if (buttonCssClass) { @@ -33,7 +33,7 @@ function getUserDataButtonHtml(method, itemId, serverId, buttonCssClass, iconCss iconCssClass = ''; } - iconCssClass += 'material-design-icons-iconfont'; + iconCssClass += 'material-icons'; return ''; } diff --git a/src/elements/emby-itemscontainer/emby-itemscontainer.js b/src/elements/emby-itemscontainer/emby-itemscontainer.js index f50b8db9f7..ddb5faa63a 100644 --- a/src/elements/emby-itemscontainer/emby-itemscontainer.js +++ b/src/elements/emby-itemscontainer/emby-itemscontainer.js @@ -1,4 +1,3 @@ - import itemShortcuts from '../../components/shortcuts'; import inputManager from '../../scripts/inputManager'; import { playbackManager } from '../../components/playback/playbackmanager'; @@ -74,8 +73,8 @@ import ServerConnections from '../../components/ServerConnections'; } const self = this; - import('../../components/multiSelect/multiSelect').then((MultiSelect) => { - self.multiSelect = new MultiSelect.default({ + import('../../components/multiSelect/multiSelect').then(({default: MultiSelect}) => { + self.multiSelect = new MultiSelect({ container: self, bindOnClick: false }); diff --git a/src/elements/emby-select/emby-select.js b/src/elements/emby-select/emby-select.js index f3d38fd31e..4d336a63a9 100644 --- a/src/elements/emby-select/emby-select.js +++ b/src/elements/emby-select/emby-select.js @@ -1,4 +1,3 @@ - import layoutManager from '../../components/layoutManager'; import browser from '../../scripts/browser'; import actionsheet from '../../components/actionSheet/actionSheet'; diff --git a/src/scripts/clientUtils.js b/src/scripts/clientUtils.js index 0587f6e4cd..b4bc3f819b 100644 --- a/src/scripts/clientUtils.js +++ b/src/scripts/clientUtils.js @@ -152,9 +152,9 @@ export function showLoadingMsg() { export function confirm(message, title, callback) { baseConfirm(message, title).then(function() { - callback(!0); + callback(true); }).catch(function() { - callback(!1); + callback(false); }); } diff --git a/src/scripts/globalize.js b/src/scripts/globalize.js index 0d7c137f73..e3e70ada1d 100644 --- a/src/scripts/globalize.js +++ b/src/scripts/globalize.js @@ -143,7 +143,6 @@ import { Events } from 'jellyfin-apiclient'; return Promise.all(promises); } - const cacheParam = new Date().getTime(); function loadTranslation(translations, lang) { lang = normalizeLocaleName(lang); let filtered = translations.filter(function (t) { @@ -156,7 +155,6 @@ import { Events } from 'jellyfin-apiclient'; }); } - //import('../strings/') return new Promise(function (resolve, reject) { if (!filtered.length) { resolve(); diff --git a/src/scripts/libraryMenu.js b/src/scripts/libraryMenu.js index 03b28fc096..97d2d6ecab 100644 --- a/src/scripts/libraryMenu.js +++ b/src/scripts/libraryMenu.js @@ -978,8 +978,6 @@ import ServerConnections from '../components/ServerConnections'; updateLibraryNavLinks(page); }); - renderHeader(); - Events.on(ServerConnections, 'localusersignedin', function (e, user) { const currentApiClient = ServerConnections.getApiClient(user.ServerId); diff --git a/src/scripts/mouseManager.js b/src/scripts/mouseManager.js index f86806c2e8..3f37dfbd9e 100644 --- a/src/scripts/mouseManager.js +++ b/src/scripts/mouseManager.js @@ -1,4 +1,3 @@ - import inputManager from './inputManager'; import focusManager from '../components/focusManager'; import browser from '../scripts/browser';