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.
This commit is contained in:
Brock Whittaker
2017-04-06 13:45:24 -07:00
parent 262a4d5da6
commit 406c113ce1

View File

@@ -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 () {