Skip to content

Commit

Permalink
change func name
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM committed Oct 12, 2022
1 parent 7e94135 commit 3e6dd4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bundle/Resources/public/js/scripts/admin.back.to.top.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const backToTopBtnTitle = backToTopBtn.querySelector('.ibexa-back-to-top__title');
let currentBackToTopAnchorHeight = backToTopAnchor.offsetHeight;
const toggleBackToTopBtnText = (container) => {
const setBackToTopBtnTextVisibility = (container) => {
const isTitleVisible = Math.abs(container.scrollHeight - container.scrollTop - container.clientHeight) <= 2;

backToTopBtn.classList.toggle('ibexa-back-to-top__btn--visible', container.scrollTop !== 0);
Expand All @@ -20,7 +20,7 @@
backToTopScrollContainer.addEventListener('scroll', (event) => {
const container = event.target;

toggleBackToTopBtnText(container);
setBackToTopBtnTextVisibility(container);
});
backToTopBtn.addEventListener('click', () => {
backToTopAnchor.scrollIntoView({
Expand All @@ -35,7 +35,7 @@

currentBackToTopAnchorHeight = entries[0].target.clientHeight;

toggleBackToTopBtnText(backToTopScrollContainer);
setBackToTopBtnTextVisibility(backToTopScrollContainer);
});

resizeObserver.observe(backToTopAnchor);
Expand Down

0 comments on commit 3e6dd4e

Please sign in to comment.