Skip to content

Instantly share code, notes, and snippets.

@skipjac
Created March 27, 2014 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skipjac/9819431 to your computer and use it in GitHub Desktop.
Save skipjac/9819431 to your computer and use it in GitHub Desktop.
HelpCenter hide ticket forms options based on organization ID
<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>
@skipjac
Copy link
Author

skipjac commented Mar 27, 2014

you also need to have css to for the class added

.hide-option {
display: none;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment