From 406c113ce1b2f19a070ea102861230a42cb7ef3c Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Thu, 6 Apr 2017 13:45:24 -0700 Subject: [PATCH] integrations: Remove left-over integration instruction blocks. In cases where a user goes from one hash to another in which neither hash is "#", it will not properly clear the last instruction block. Fixes: #4407. --- static/js/portico/landing-page.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/portico/landing-page.js b/static/js/portico/landing-page.js index 24ca62db66..5564d7803f 100644 --- a/static/js/portico/landing-page.js +++ b/static/js/portico/landing-page.js @@ -45,11 +45,16 @@ var integration_events = function () { // the version of the hash without the leading "#". var _hash = hash.replace(/^#/, ""); + // clear out the integrations instructions that may exist in the instruction + // block from a previous hash. + $("#integration-instruction-block .integration-instructions") + .appendTo("#integration-instructions-group"); + if (hashes.indexOf(_hash) > -1) { $lozenge_icon = $(".integration-lozenges .integration-lozenge.integration-" + _hash).clone(true); currentblock = $(hash); instructionbox.hide().children(".integration-lozenge").replaceWith($lozenge_icon); - instructionbox.append($lozenge_icon, currentblock); + instructionbox.append($lozenge_icon); $(".inner-content").removeClass("show"); setTimeout(function () {