Skip to content

Commit

Permalink
Add two new paths where webchat is available
Browse files Browse the repository at this point in the history
As requested by HMRC, these two outcome pages from smart answers need
webchat assistance. The only change here is making the script load the
iframe on those two paths in addition to the self-assessment page.
  • Loading branch information
Christoph Wong committed Jan 8, 2016
1 parent 07c164f commit b3dbf65
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 b3dbf65

Please sign in to comment.