Skip to content

Commit

Permalink
Merge pull request #18 from stackbithq/hide-topbar-query-params
Browse files Browse the repository at this point in the history
Hide top bar by url param
  • Loading branch information
VitaliyR committed Oct 22, 2020
2 parents f1b988b + 93d40a2 commit dd45ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/supporting-files/stackbit-banner.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = `<div id="theme-bar" class="theme-bar theme-bar-fixed theme-bar
<script>
var body = document.querySelector("body");
var themebar = document.querySelector("#theme-bar");
var hideThemeBar = sessionStorage.getItem('hideThemeBar');
var hideThemeBar = sessionStorage.getItem('hideThemeBar') || window.location.search.indexOf('hideThemeBar') >= 0;
if (body && !hideThemeBar) {
body.classList.add("has-theme-bar");
themebar.classList.remove("theme-bar-hidden");
Expand All @@ -69,4 +69,4 @@ module.exports = `<div id="theme-bar" class="theme-bar theme-bar-fixed theme-bar
sessionStorage.setItem('hideThemeBar', true);
});
</script>
`;
`;

0 comments on commit dd45ce6

Please sign in to comment.