Display scrollbar in recordings table when needed

This commit is contained in:
David Rowe 2017-04-20 14:19:25 +12:00
parent 2108300272
commit 0da4e3e3c4
3 changed files with 71 additions and 18 deletions

View file

@ -11,6 +11,7 @@
body { body {
padding: 0; padding: 0;
overflow: hidden;
} }
.title { .title {
@ -26,27 +27,51 @@ body {
#recordings { #recordings {
height: 100%; height: 100%;
position: absolute; position: relative;
top: 0;
left: 0;
padding: 63px 21px 158px 21px;
box-sizing: border-box; box-sizing: border-box;
padding: 48px 0 214px 0;
margin: 0 21px 0 21px;
}
#recordings #table-container {
height: 100%;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
box-sizing: border-box;
border-left: 2px solid #575757;
border-right: 2px solid #575757;
background-color: #2e2e2e;
} }
#recordings table { #recordings table {
height: 100%; border: none;
table-layout: fixed;
background: none !important;
} }
#recordings thead, #recordings thead tr { #recordings thead {
background: none !important; position: absolute;
top: 19px;
left: 0;
width: 100%;
box-sizing: border-box;
border: 2px solid #575757;
border-top-left-radius: 7px;
border-top-right-radius: 7px;
border-bottom: 1px solid #575757;
position: absolute;
word-wrap: nowrap;
white-space: nowrap;
overflow: hidden;
} }
#recordings table col#unload-column { #recordings table col#unload-column {
width: 100px; width: 100px;
} }
#recordings thead th:last-child {
width: 100px;
}
#recordings table td { #recordings table td {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
@ -57,16 +82,34 @@ body {
#recordings tbody tr.filler td { #recordings tbody tr.filler td {
height: auto; height: auto;
background-color: #2e2e2e;
border-top: 1px solid #1c1c1c; border-top: 1px solid #1c1c1c;
} }
#recordings-list tr td:last-child span { #recordings-list tr td:last-child span {
font-family: HiFi-Glyphs; font-family: HiFi-Glyphs;
font-size: 24px; font-size: 24px;
height: 24px; height: 24px;
display: inline-block; }
#recordings tfoot {
position: absolute;
bottom: 189px;
left: 0;
width: 100%;
box-sizing: border-box;
border: 2px solid #575757;
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px;
border-top: 1px solid #575757;
}
#recordings tfoot tr, #recordings tfoot td {
background: none;
}
#recordings #load-container {
position: relative;
top: 25px;
} }

View file

@ -16,7 +16,7 @@ var isUsingToolbar = false,
numberOfPlayers = 0, numberOfPlayers = 0,
recordingsBeingPlayed = [], recordingsBeingPlayed = [],
elRecordings, elRecordings,
elRecordingsPlaying, elRecordingsTable,
elRecordingsList, elRecordingsList,
elInstructions, elInstructions,
elPlayersUnused, elPlayersUnused,
@ -61,6 +61,8 @@ function updateRecordings() {
td, td,
span, span,
input, input,
ths,
tds,
length, length,
i, i,
HIFI_GLYPH_CLOSE_SMALL = "C"; HIFI_GLYPH_CLOSE_SMALL = "C";
@ -105,8 +107,16 @@ function updateRecordings() {
tr.appendChild(td); tr.appendChild(td);
tbody.appendChild(tr); tbody.appendChild(tr);
elRecordingsPlaying.replaceChild(tbody, elRecordingsList); // Update table content.
elRecordingsTable.replaceChild(tbody, elRecordingsList);
elRecordingsList = document.getElementById("recordings-list"); elRecordingsList = document.getElementById("recordings-list");
// Update header cell widths to match content widths.
ths = document.querySelectorAll("#recordings-table thead th");
tds = document.querySelectorAll("#recordings-table tbody tr:first-child td");
for (i = 0; i < ths.length; i += 1) {
ths[i].width = tds[i].offsetWidth;
}
} }
function updateInstructions() { function updateInstructions() {
@ -251,7 +261,7 @@ function onBodyLoaded() {
elRecordings = document.getElementById("recordings"); elRecordings = document.getElementById("recordings");
elRecordingsPlaying = document.getElementById("recordings-playing"); elRecordingsTable = document.getElementById("recordings-table");
elRecordingsList = document.getElementById("recordings-list"); elRecordingsList = document.getElementById("recordings-list");
elInstructions = document.getElementById("instructions"); elInstructions = document.getElementById("instructions");
elPlayersUnused = document.getElementById("players-unused"); elPlayersUnused = document.getElementById("players-unused");

View file

@ -21,8 +21,8 @@
</div> </div>
<hr /> <hr />
<div id="recordings"> <div id="recordings">
<div> <div id="table-container">
<table id="recordings-playing"> <table id="recordings-table">
<colgroup> <colgroup>
<col /> <col />
<col id="unload-column" /> <col id="unload-column" />
@ -58,7 +58,7 @@
</tfoot> </tfoot>
</table> </table>
</div> </div>
<div> <div id="load-container">
<input id="load-button" type="button" value="Load" disabled /> <input id="load-button" type="button" value="Load" disabled />
</div> </div>
</div> </div>