diff --git a/src/agenda_culturel/static/js/calendar-buttons.js b/src/agenda_culturel/static/js/calendar-buttons.js index 61dcf2a..00181e7 100644 --- a/src/agenda_culturel/static/js/calendar-buttons.js +++ b/src/agenda_culturel/static/js/calendar-buttons.js @@ -2,26 +2,39 @@ function displayButtons() { + delta = 60 agenda = document.getElementById("calendar"); grid = agenda.querySelector(".grid"); - buttonLeft = agenda.querySelector(".slider-button.button-left"); - buttonRight = agenda.querySelector(".slider-button.button-right"); + buttonLeft = agenda.querySelector(".slider-button.slider-button-inside.button-left"); + buttonRight = agenda.querySelector(".slider-button.slider-button-inside.button-right"); + buttonLeftPage = agenda.querySelector(".slider-button.slider-button-page.button-left"); + buttonRightPage = agenda.querySelector(".slider-button.slider-button-page.button-right"); if (agenda.offsetWidth < grid.offsetWidth) { - if (agenda.scrollLeft == 0) + if (agenda.scrollLeft < delta) { buttonLeft.classList.add("hidden"); - else + buttonLeftPage.classList.remove("hidden"); + } + else { buttonLeft.classList.remove("hidden"); - if (agenda.scrollLeft + agenda.offsetWidth - grid.offsetWidth == 0) + buttonLeftPage.classList.add("hidden"); + } + if (agenda.scrollLeft + agenda.offsetWidth - grid.offsetWidth >= -2) { buttonRight.classList.add("hidden"); - else + buttonRightPage.classList.remove("hidden"); + } + else { buttonRight.classList.remove("hidden"); + buttonRightPage.classList.add("hidden"); + } } else { buttonLeft.classList.add("hidden"); buttonRight.classList.add("hidden"); + buttonLeftPage.classList.add("hidden"); + buttonRightPage.classList.add("hidden"); } } diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index 6c77f39..a858164 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -312,10 +312,13 @@ footer [data-tooltip] { border-radius: 1em; line-height: 2em; text-align: center; - position: absolute; - top: 75vh; + position: fixed; + top: 65vh; z-index: 10; opacity: 0.9; + a { + color: var(--primary-inverse); + } } .slider-button.hidden { display: none; diff --git a/src/agenda_culturel/templates/agenda_culturel/page-month.html b/src/agenda_culturel/templates/agenda_culturel/page-month.html index 06c9f9d..cdcd681 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-month.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-month.html @@ -54,7 +54,13 @@