Skip to content

Commit

Permalink
Merge pull request #2060 from alphagov/hide-global-bar-on-the-referre…
Browse files Browse the repository at this point in the history
…d-page

Hide global bar on the referred page
  • Loading branch information
alex-ju authored Mar 4, 2020
2 parents 8407a1e + 4996cb6 commit 638f904
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/assets/javascripts/global-bar-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ var globalBarInit = {

blacklistedUrl: function() {
var paths = [
"/register-to-vote",
"/done",
"/transition",
"/transition-check"
]

var ctaLink = document.querySelector('.js-call-to-action')
if (ctaLink) {
paths.push(ctaLink.getAttribute('href'))
}

return new RegExp(paths.join("|")).test(window.location.pathname)
},

Expand Down

0 comments on commit 638f904

Please sign in to comment.