mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Hide admin menus if in TV layout
This commit is contained in:
parent
9518ffa456
commit
350195b5bc
2 changed files with 10 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
import appHost from 'apphost';
|
||||
import layoutManager from 'layoutManager';
|
||||
import 'listViewStyle';
|
||||
import 'emby-button';
|
||||
|
||||
|
@ -38,19 +39,19 @@ export default function (view, params) {
|
|||
page.querySelector('.selectServer').classList.add('hide');
|
||||
}
|
||||
|
||||
// hide the actions if user preferences are being edited for a different user
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
page.querySelector('.headerUsername').innerHTML = user.Name;
|
||||
if (user.Policy.IsAdministrator && !layoutManager.tv) {
|
||||
page.querySelector('.adminSection').classList.remove('hide');
|
||||
}
|
||||
});
|
||||
|
||||
// Hide the actions if user preferences are being edited for a different user
|
||||
if (params.userId && params.userId !== Dashboard.getCurrentUserId) {
|
||||
page.querySelector('.userSection').classList.add('hide');
|
||||
page.querySelector('.adminSection').classList.add('hide');
|
||||
}
|
||||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
page.querySelector('.headerUsername').innerHTML = user.Name;
|
||||
if (!user.Policy.IsAdministrator) {
|
||||
page.querySelector('.adminSection').classList.add('hide');
|
||||
}
|
||||
});
|
||||
|
||||
import('autoFocuser').then(({default: autoFocuser}) => {
|
||||
autoFocuser.autoFocus(view);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue