Skip to content

Commit

Permalink
Merge pull request #21 from KTH/fix/catch-up-with-9
Browse files Browse the repository at this point in the history
Fix: catch up with v9
  • Loading branch information
falric authored Feb 29, 2024
2 parents a834c43 + fde0159 commit 95b6949
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 309 deletions.
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test": "echo \"ok\"",
"build": "./build.sh prod",
"build-dev": "./build.sh dev",
"prepare": "husky install",
"prepare": "husky",
"echoit": "echo 'This is inside echoit'",
"lint": "eslint \"public/**/*.{js,jsx}\" --quiet",
"lint-v": "eslint \"public/**/*.{js,jsx}\" ",
Expand All @@ -47,7 +47,7 @@
"babel-js-prod": "babel --minified --source-maps false public/js --out-dir dist/js"
},
"dependencies": {
"bootstrap": "^5.3.2",
"bootstrap": "^5.3.3",
"jquery": "^3.6.0",
"tether": "^2.0.0"
},
Expand All @@ -59,7 +59,7 @@
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^10.2.4",
"eslint": "^8.20.0",
"husky": "^7.0.4",
"husky": "^9.0.11",
"prettier": "^2.7.1",
"pretty-quick": "3.1.3",
"sass": "^1.53.0",
Expand Down
8 changes: 6 additions & 2 deletions public/js/backtotop.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ window.addEventListener('load', () => {
} else {
backToTopButton.innerText = 'To page top'
}
if (document.querySelector('footer')) {
document.body.insertBefore(backToTopButton, document.querySelector('footer'))

const pageFooter = document.querySelector('body > footer')
if (pageFooter) {
// Insert back to top button before footer
pageFooter.parentNode.insertBefore(backToTopButton, pageFooter)
}
}
// Scroll to top when clicking the button
backToTopButton.addEventListener('click', function () {
window.scrollTo({ top: 0, behavior: 'smooth' })
this.classList.toggle('show')
Expand Down
Loading

0 comments on commit 95b6949

Please sign in to comment.