Remove space reservation in sidebar for anime info

This commit is contained in:
Eduard Urbach 2018-03-12 00:59:23 +01:00
parent 5e552f2541
commit 5e583819d3
4 changed files with 12 additions and 8 deletions

View File

@ -1,6 +1,6 @@
component AudioPlayer
#audio-player
#audio-player-anime-info
#audio-player-anime-info.hidden
a#audio-player-anime-link.ajax(href="", title="")
img#audio-player-anime-image.lazy.hidden(data-src="", data-webp="true", alt="Anime cover")

View File

@ -3,7 +3,7 @@
default-transition
justify-content center
position relative
margin 0.8rem 0
margin-bottom 0.8rem
flex-shrink 0
#audio-player-anime-info
@ -11,6 +11,7 @@
justify-content center
align-items center
width 100%
margin-top 0.8rem
#audio-player-anime-link
width 142px

View File

@ -35,10 +35,6 @@ component Sidebar(user *arn.User)
//- if arn.IsDevelopment()
//- SidebarButton("Groups", "/groups", "users")
if user != nil && (user.Role == "editor" || user.Role == "admin")
SidebarButton("Editor", "/editor", "pencil")
SidebarButton("Log", "/log", "list")
//- Disabled:
//- SidebarButton("Dash", "/dashboard", "tachometer")
@ -59,8 +55,12 @@ component Sidebar(user *arn.User)
Icon("search")
FuzzySearch
if user != nil && user.Role == "admin"
SidebarButton("Admin", "/admin", "wrench")
if user != nil && (user.Role == "editor" || user.Role == "admin")
SidebarButton("Log", "/log", "list")
SidebarButton("Editor", "/editor", "pencil")
//- if user != nil && user.Role == "admin"
//- SidebarButton("Admin", "/admin", "wrench")
a.sidebar-link.action(href="#", data-action="toggleTheme", data-trigger="click")
.sidebar-button

View File

@ -11,6 +11,7 @@ var audioPlayer = document.getElementById("audio-player")
var audioPlayerPlay = document.getElementById("audio-player-play")
var audioPlayerPause = document.getElementById("audio-player-pause")
var trackLink = document.getElementById("audio-player-track-title") as HTMLLinkElement
var animeInfo = document.getElementById("audio-player-anime-info") as HTMLElement
var animeLink = document.getElementById("audio-player-anime-link") as HTMLLinkElement
var animeImage = document.getElementById("audio-player-anime-image") as HTMLImageElement
@ -86,6 +87,7 @@ function playAudioFile(arn: AnimeNotifier, trackId: string, trackUrl: string) {
// Set anime info
if(animeId !== "") {
animeInfo.classList.remove("hidden")
let animeResponse = await fetch("/api/anime/" + animeId)
let anime = await animeResponse.json()
animeLink.title = anime.title.canonical
@ -129,6 +131,7 @@ export function stopAudio(arn: AnimeNotifier) {
// Hide anime info
animeLink.href = ""
animeInfo.classList.add("hidden")
animeImage.classList.add("hidden")
if(gainNode) {