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

update menu creation

This commit is contained in:
Luke Pulverenti 2016-04-23 14:48:57 -04:00
parent 1caad9ae47
commit fc06b2eac8

View file

@ -1,4 +1,4 @@
define(['imageLoader', 'layoutManager', 'jQuery', 'paper-icon-button', 'emby-icons'], function (imageLoader, layoutManager, $) {
define(['imageLoader', 'layoutManager', 'jQuery'], function (imageLoader, layoutManager, $) {
var mainDrawerPanel = document.querySelector('.mainDrawerPanel');
@ -87,7 +87,7 @@
var url = user.imageUrl;
if (user.supportsImageParams) {
url += "&height=" + (userButtonHeight * Math.max(window.devicePixelRatio || 1, 2));
url += "&height=" + Math.round((userButtonHeight * Math.max(window.devicePixelRatio || 1, 2)));
}
if (headerUserButton) {
@ -993,7 +993,7 @@
if (!e.detail.isRestored) {
// Scroll back up so in case vertical scroll was messed with
window.scrollTo(0, 0);
//window.scrollTo(0, 0);
}
updateTitle(page);
@ -1126,8 +1126,18 @@
}
mainDrawerPanel.addEventListener('iron-select', onMainDrawerSelect);
var headerCreated;
var userRequiresUpdateAfterHeader;
renderHeader();
require(['paper-icon-button', 'emby-icons'], function () {
renderHeader();
headerCreated = true;
if (userRequiresUpdateAfterHeader) {
updateUserInHeader(user);
}
userRequiresUpdateAfterHeader = null;
});
Events.on(ConnectionManager, 'apiclientcreated', function (e, apiClient) {
initializeApiClient(apiClient);
@ -1138,7 +1148,12 @@
var apiClient = ConnectionManager.getApiClient(user.ServerId);
ConnectionManager.user(ConnectionManager.getApiClient(user.ServerId)).then(function (user) {
refreshLibraryDrawer(user);
updateUserInHeader(user);
if (headerCreated) {
updateUserInHeader(user);
} else {
userRequiresUpdateAfterHeader = user;
}
});
if (!AppInfo.isNativeApp) {