Skip to content

Commit

Permalink
Hiding previous/next buttons in all time view
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Brock committed Oct 4, 2022
1 parent f81de31 commit 03167d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ <h1 class="mt-4" id="headline_history">...</h1>
<div class="col-xl-6">
<div class="d-flex flex-row">
<!-- BACK -->
<button type="button" class="btn btn-outline-secondary me-2" onclick="datePrev();"><i
<button id="selection_prev" type="button" class="btn btn-outline-secondary me-2" onclick="datePrev();"><i
class="fa-solid fa-angle-left"></i></button>
<!-- Year -->
<div id="selection_year">
Expand Down Expand Up @@ -1292,7 +1292,7 @@ <h1 class="mt-4" id="headline_history">...</h1>
</select>
</div>
<!-- FORWARD -->
<button type="button" class="btn btn-outline-secondary ms-2" onclick="dateNext();"><i
<button id="selection_next" type="button" class="btn btn-outline-secondary ms-2" onclick="dateNext();"><i
class="fa-solid fa-angle-right"></i></button>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions site/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,17 @@ function showViewHistory(mode) {
case histories.TODAY:
selectDate(new Date());
document.getElementById("headline_history").innerHTML = getHistoryString("daily_data");
setElementVisible("selection_prev", true);
setElementVisible("selection_next", true);
setElementVisible("selection_year", true);
setElementVisible("selection_month", true);
setElementVisible("selection_day", true);
setElementVisible("history_card_graphs", false);
setElementVisible("history_card_high_res", true);
case histories.DAY:
document.getElementById("headline_history").innerHTML = getHistoryString("daily_data");
setElementVisible("selection_prev", true);
setElementVisible("selection_next", true);
setElementVisible("selection_year", true);
setElementVisible("selection_month", true);
setElementVisible("selection_day", true);
Expand All @@ -351,6 +355,8 @@ function showViewHistory(mode) {
break;
case histories.MONTH:
document.getElementById("headline_history").innerHTML = getHistoryString("monthly_data");
setElementVisible("selection_prev", true);
setElementVisible("selection_next", true);
setElementVisible("selection_year", true);
setElementVisible("selection_month", true);
setElementVisible("selection_day", false);
Expand All @@ -360,6 +366,8 @@ function showViewHistory(mode) {
break;
case histories.YEAR:
document.getElementById("headline_history").innerHTML = getHistoryString("yearly_data");
setElementVisible("selection_prev", true);
setElementVisible("selection_next", true);
setElementVisible("selection_year", true);
setElementVisible("selection_month", false);
setElementVisible("selection_day", false);
Expand All @@ -369,6 +377,8 @@ function showViewHistory(mode) {
break;
case histories.ALL:
document.getElementById("headline_history").innerHTML = getHistoryString("all_time_data");
setElementVisible("selection_prev", false);
setElementVisible("selection_next", false);
setElementVisible("selection_year", false);
setElementVisible("selection_month", false);
setElementVisible("selection_day", false);
Expand Down

0 comments on commit 03167d0

Please sign in to comment.