Skip to content

Instantly share code, notes, and snippets.

@cupertinobr
Created July 17, 2025 13:36
Show Gist options
  • Select an option

  • Save cupertinobr/d2cb81e1c56718b1c17c31945703935e to your computer and use it in GitHub Desktop.

Select an option

Save cupertinobr/d2cb81e1c56718b1c17c31945703935e to your computer and use it in GitHub Desktop.
<script>
// Função para esconder os campos
function esconderCampos() {
var codiempr = document.getElementById('SC_codiempr').value;
var codiempr = codiempr.charAt(0);
if (codiempr > 0) {
$('#SC_status_label').hide();
$('#id_hide_status').hide();
} else {
$('#SC_status_label').show();
$('#id_hide_status').show();
}
}
// Observer para detectar mudanças no DOM
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.type === 'childList') {
esconderCampos();
}
});
});
// Observar mudanças no body
observer.observe(document.body, {
childList: true,
subtree: true
});
$(document).ready(esconderCampos);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment