diff --git a/app/views/application/_event_nav.html.slim b/app/views/application/_event_nav.html.slim index d66e07f..01e0fb8 100644 --- a/app/views/application/_event_nav.html.slim +++ b/app/views/application/_event_nav.html.slim @@ -1,4 +1,4 @@ -.mt-3.row style="font-size: 16px;" +.mt-3.row style="font-size: 16px;" id="event-nav" .col ul.nav.nav-tabs.mb-4 - @contest.event.contests.where(public: true).each do |contest| diff --git a/app/views/contests/_scoreboard_desktop_marathon.html.slim b/app/views/contests/_scoreboard_desktop_marathon.html.slim index 5cd89d3..d2185f2 100644 --- a/app/views/contests/_scoreboard_desktop_marathon.html.slim +++ b/app/views/contests/_scoreboard_desktop_marathon.html.slim @@ -1,4 +1,14 @@ -.d-flex.flex-column style="height: calc(100vh - 210px); width: 100%;" +.d-flex.flex-column style="height: calc(100vh - 210px); width: 100%;" id="scoreboard-container" + + javascript: + function adaptHeight() { + const tabsEl = document.getElementById('event-nav'); + const scoreboardContainerEl = document.getElementById('scoreboard-container'); + scoreboardContainerEl.style.height = `calc(100vh - ${180 + tabsEl.offsetHeight}px)`; + } + + adaptHeight(); + addEventListener('resize', adaptHeight); = render "selectors" diff --git a/app/views/contests/_scoreboard_desktop_single.html.slim b/app/views/contests/_scoreboard_desktop_single.html.slim index 69cd866..fa9e8e1 100644 --- a/app/views/contests/_scoreboard_desktop_single.html.slim +++ b/app/views/contests/_scoreboard_desktop_single.html.slim @@ -1,5 +1,16 @@ .row style="width: 100%;" - .col-6.d-flex.flex-column style="height: calc(100vh - 260px); margin-top: #{active_page("/public/event/") == "active" ? "0" : "1rem"};" + .col-6.d-flex.flex-column id="scoreboard-container" style="height: calc(100vh - 260px); margin-top: #{active_page("/public/event/") == "active" ? "0" : "1rem"};" + + javascript: + function adaptHeight() { + const tabsEl = document.getElementById('event-nav'); + const scoreboardContainerEl = document.getElementById('scoreboard-container'); + scoreboardContainerEl.style.height = `calc(100vh - ${180 + tabsEl.offsetHeight}px)`; + } + + adaptHeight(); + addEventListener('resize', adaptHeight); + .d-flex.flex-column style="overflow-y: auto" table.table.table-striped.table-hover thead