Created
March 27, 2014 21:30
-
-
Save skipjac/9819431 to your computer and use it in GitHub Desktop.
HelpCenter hide ticket forms options based on organization ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function(){ | |
(function(){ | |
$('option[value="641"]').wrap('<span class="hide-option"></span>'); | |
var isCust; | |
function isCustomer(element, index, array){ | |
return (element === 'paying'); | |
} | |
HelpCenter.user.organizations.forEach(function(x){ | |
isCust = x.tags.some(isCustomer); | |
return (isCust === true); | |
}); | |
if(isCust === true){ | |
$('option[value="641"]').unwrap('<span class="hide-option"></span>'); | |
} | |
}()); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you also need to have css to for the class added
.hide-option {
display: none;
}