We have a Help Center theme that hides one form (Form A) from all users except members of one organization (Group A). This code has been working as expected since May of last year.
We have been asked to add a new form and organization. Along with new visibility rules for them. We'll call ne new form and group, Form B and Group B.
Form A (360003482932) must be visible to Group A and Group B. But Form B (14992348743700) must only be visible to Group B.
The code on the live Help Center theme is as follows.
document.addEventListener('DOMContentLoaded', function() {
// Key map
var Redacted;
var Redacted;
var Redacted;
var Redacted;
var Redacted;
var Redacted;
var i = 0;
var checkExist = setInterval(function() {
i++;
if ($("a.nesty-input").length){
clearInterval(checkExist);
$("a.nesty-input").each(function() {
$(this).bind( "click", function() {
for (var c in HelpCenter.user.organizations) {
if (HelpCenter.user.organizations[c].name === "Group A"){
$("#360003482932").show();
}
else{$("#360003482932").hide()}
//reserve space for additional organizations
The code in the test theme is as follows.
document.addEventListener('DOMContentLoaded', function() {
// Key map
var ENTER = 13;
var ESCAPE = 27;
var SPACE = 32;
var UP = 38;
var DOWN = 40;
var TAB = 9;
var i = 0;
var checkExist = setInterval(function() {
i++;
if ($("a.nesty-input").length){
clearInterval(checkExist);
$("a.nesty-input").each(function() {
$(this).bind( "click", function() {
for (var c in HelpCenter.user.organizations) {
if (HelpCenter.user.organizations[c].name === "Group A" || HelpCenter.user.organizations[c].name === "Group B"){
$("#360003482932").show();
}
else{$("#360003482932").hide()}
if (HelpCenter.user.organizations[c].name === "Group B"){
$("#14992348743700").show();
}
else{$("#14992348743700").hide()}
//reserve space for additional organizations
The thing that has me confused is that members of both Group A and Group B can see Form A. So, the code is recognizing the new organization, and treating Form A correctly.
But Form B is not visible regardless of organization membership. So, why is Form A being displayed correctly while Form B is not?