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
|
@ -57,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="adminSection verticalSection verticalSection-extrabottompadding">
|
<div class="adminSection verticalSection verticalSection-extrabottompadding hide">
|
||||||
<h2 class="sectionTitle" style="padding-left:.25em;">${HeaderAdmin}</h2>
|
<h2 class="sectionTitle" style="padding-left:.25em;">${HeaderAdmin}</h2>
|
||||||
<a is="emby-linkbutton" href="dashboard.html" style="display:block;padding:0;margin:0;" class="listItem-border">
|
<a is="emby-linkbutton" href="dashboard.html" style="display:block;padding:0;margin:0;" class="listItem-border">
|
||||||
<div class="listItem">
|
<div class="listItem">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import appHost from 'apphost';
|
import appHost from 'apphost';
|
||||||
|
import layoutManager from 'layoutManager';
|
||||||
import 'listViewStyle';
|
import 'listViewStyle';
|
||||||
import 'emby-button';
|
import 'emby-button';
|
||||||
|
|
||||||
|
@ -38,19 +39,19 @@ export default function (view, params) {
|
||||||
page.querySelector('.selectServer').classList.add('hide');
|
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) {
|
if (params.userId && params.userId !== Dashboard.getCurrentUserId) {
|
||||||
page.querySelector('.userSection').classList.add('hide');
|
page.querySelector('.userSection').classList.add('hide');
|
||||||
page.querySelector('.adminSection').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}) => {
|
import('autoFocuser').then(({default: autoFocuser}) => {
|
||||||
autoFocuser.autoFocus(view);
|
autoFocuser.autoFocus(view);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue