Skip to content

Commit

Permalink
Merge pull request #707 from alphagov/add-webchat-banner-for-simple-s…
Browse files Browse the repository at this point in the history
…mart-answers

Change insertion point selector so webchat banner appears on new pages
  • Loading branch information
tombooth committed Jan 13, 2016
2 parents ce03155 + b35dc2f commit b0cc136
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/webchat.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if (window.sessionStorage && window.postMessage) {
if (webchat.shouldOpen()) {

insertionPoint = $('.beta-wrapper').length ? $('.beta-wrapper') : $('.heading-block');
insertionPoint = $('.beta-wrapper').length ? $('.beta-wrapper') : $('#content > header');
insertionPoint.after('<div class="webchat-banner" aria-hidden="true"><h2>Talk to an HMRC adviser online</h2><p>You can use web chat instead of calling HMRC’s helpline.</p><a href="#" class="accept">Start web chat</a> <a href="#" class="reject">I’m not interested</a></div>');

webchat.$chatFrame = $('<iframe class="hidden" />');
Expand Down
2 changes: 1 addition & 1 deletion spec/javascripts/hmrc-webchat-spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('HMRC webchat', function () {
var INSERTION_HOOK = '<div class="heading-block"></div>';
var INSERTION_HOOK = '<main id="content"><header></header></div>';

beforeEach(function() {
spyOn(GOVUK.webchat, 'shouldOpen').and.returnValue(true);
Expand Down

0 comments on commit b0cc136

Please sign in to comment.