mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
remove duplicate button to home screen settings
This commit is contained in:
parent
658d77c15f
commit
ba1219f78b
@ -183,28 +183,19 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
||||
}
|
||||
|
||||
function getLibraryButtonsHtml(items) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += '<div class="verticalSection verticalSection-extrabottompadding">';
|
||||
html += '<div class="sectionTitleContainer sectionTitleContainer-cards">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards padded-left">' + globalize.translate('HeaderMyMedia') + '</h2>';
|
||||
|
||||
if (!layoutManager.tv) {
|
||||
html += '<button type="button" is="paper-icon-button-light" class="sectionTitleIconButton btnHomeScreenSettings"><i class="md-icon"></i></button>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div is="emby-itemscontainer" class="itemsContainer padded-left padded-right vertical-wrap focuscontainer-x" data-multiselect="false">';
|
||||
|
||||
// "My Library" backgrounds
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
var item = items[i];
|
||||
|
||||
var icon;
|
||||
|
||||
switch (item.CollectionType) {
|
||||
case "movies":
|
||||
icon = "local_movies";
|
||||
@ -258,7 +249,6 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
||||
var html = getLibraryButtonsHtml(userViews);
|
||||
|
||||
elem.innerHTML = html;
|
||||
bindHomeScreenSettingsIcon(elem, apiClient, user.Id, userSettings);
|
||||
imageLoader.lazyChildren(elem);
|
||||
}
|
||||
|
||||
@ -410,42 +400,11 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
||||
}
|
||||
|
||||
function getRequirePromise(deps) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(deps, resolve);
|
||||
});
|
||||
}
|
||||
|
||||
function showHomeScreenSettings(elem, options) {
|
||||
return getRequirePromise(['homescreenSettingsDialog']).then(function (homescreenSettingsDialog) {
|
||||
|
||||
return homescreenSettingsDialog.show(options).then(function () {
|
||||
|
||||
dom.parentWithClass(elem, 'homeSectionsContainer').dispatchEvent(new CustomEvent('settingschange', {
|
||||
cancelable: false
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function bindHomeScreenSettingsIcon(elem, apiClient, userId, userSettings) {
|
||||
|
||||
var btnHomeScreenSettings = elem.querySelector('.btnHomeScreenSettings');
|
||||
if (!btnHomeScreenSettings) {
|
||||
return;
|
||||
}
|
||||
|
||||
btnHomeScreenSettings.addEventListener('click', function () {
|
||||
showHomeScreenSettings(elem, {
|
||||
serverId: apiClient.serverId(),
|
||||
userId: userId,
|
||||
userSettings: userSettings
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadLibraryTiles(elem, apiClient, user, userSettings, shape, userViews, allSections) {
|
||||
|
||||
elem.classList.remove('verticalSection');
|
||||
@ -460,11 +419,6 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
||||
|
||||
html += '<div class="sectionTitleContainer sectionTitleContainer-cards">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards padded-left">' + globalize.translate('HeaderMyMedia') + '</h2>';
|
||||
|
||||
if (!layoutManager.tv) {
|
||||
html += '<button type="button" is="paper-icon-button-light" class="sectionTitleIconButton btnHomeScreenSettings"><i class="md-icon"></i></button>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
if (scrollX) {
|
||||
@ -492,7 +446,6 @@ define(['connectionManager', 'cardBuilder', 'appSettings', 'dom', 'apphost', 'la
|
||||
}
|
||||
|
||||
elem.innerHTML = html;
|
||||
bindHomeScreenSettingsIcon(elem, apiClient, user.Id, userSettings);
|
||||
imageLoader.lazyChildren(elem);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user