Skip to content
Snippets Groups Projects
Commit b99dd331 authored by Mark Kane's avatar Mark Kane
Browse files

Fix: add baseUrl in script,

tweak show/hide behaviour (planning#404)
parent ed115022
No related branches found
No related tags found
1 merge request!179planning#404: add back-to-root button to nav,
...@@ -171,7 +171,7 @@ module.exports = { ...@@ -171,7 +171,7 @@ module.exports = {
], ],
], ],
scripts: [ { scripts: [ {
src: '/js/custom.js', src: `${baseUrl}js/custom.js`,
async: false, async: false,
}, },
], ],
......
...@@ -74,12 +74,16 @@ img { ...@@ -74,12 +74,16 @@ img {
} }
@media screen and (min-width: 1000px) { @media screen and (min-width: 1000px) {
.has-back-btn .navbar__brand { .navbar__brand {
margin-left: 32px; margin-left: 32px;
} }
.hidden-back-btn .navbar__brand {
margin-left: 0;
}
} }
.has-back-btn .navbar__toggle.clean-btn { .navbar__toggle.clean-btn {
margin-left: 32px; margin-left: 32px;
} }
......
...@@ -6,10 +6,10 @@ window.addEventListener("load", function() { ...@@ -6,10 +6,10 @@ window.addEventListener("load", function() {
const checkBackBtnVisibility = () => { const checkBackBtnVisibility = () => {
if (window.location.pathname === '/' && !btn.classList.contains('hidden')) { if (window.location.pathname === '/' && !btn.classList.contains('hidden')) {
btn.classList.add('hidden'); btn.classList.add('hidden');
nav.classList.remove('has-back-btn'); nav.classList.add('hidden-back-btn');
} else if (window.location.pathname !== '/' && btn.classList.contains('hidden')) { } else if (window.location.pathname !== '/' && btn.classList.contains('hidden')) {
btn.classList.remove('hidden'); btn.classList.remove('hidden');
nav.classList.add('has-back-btn'); nav.classList.remove('hidden-back-btn');
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment