Skip to content

Commit

Permalink
Merge pull request #702 from alphagov/add-new-paths-for-webchat
Browse files Browse the repository at this point in the history
Add two new paths where webchat is available
  • Loading branch information
dsingleton committed Jan 11, 2016
2 parents 81b9868 + b3dbf65 commit 83f8302
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/assets/javascripts/webchat.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
var webchat = {

shouldOpen: function(){
return (window.location.pathname === '/government/organisations/hm-revenue-customs/contact/self-assessment');
var webchatEnabledPaths = [
'/government/organisations/hm-revenue-customs/contact/self-assessment',
'/check-if-you-need-a-tax-return/y/employed-even-if-just-for-part-of-the-year/no/no/no-neither-of-us-claimed-child-benefit/no/no/no/none-of-these',
'/check-if-you-need-a-tax-return/y/retired/no/no-neither-of-us-claimed-child-benefit/no/no/no/none-of-these'
];

return (webchatEnabledPaths.indexOf(window.location.pathname) >= 0);
},

validOrigin: function(origin){
Expand Down Expand Up @@ -42,8 +48,6 @@

// IE7 can’t access webchat
if (window.sessionStorage && window.postMessage) {

// only initialise on the self assessment help page for the time being
if (webchat.shouldOpen()) {

insertionPoint = $('.beta-wrapper').length ? $('.beta-wrapper') : $('.heading-block');
Expand Down

0 comments on commit 83f8302

Please sign in to comment.