I have a code that when you click the disable button, asks the reason that you are turning off the photo. When you confirm this reason, it should disappear the button on the side. I have a code with javascript to do the whole part of asking the reason for disabling the photo, but I have no idea how to make the next button disappear.
This is the code in javascript:
$(document).on('click','.desativar', function(){
var t = $(this);
$.SmartMessageBox({
title : "<?= $this->lang->line("con_inflaud_jus_msg_title"); ?>",
content : "<?= $this->lang->line("con_inflaud_jus_msg_d"); ?>",
buttons : "[<?= $this->lang->line("con_inflaud_jus_msg_btn_n"); ?>][<?= $this->lang->line("con_inflaud_jus_msg_btn_y"); ?>]",
input : "text",
inputValue: "",
placeholder : "<?= $this->lang->line("con_inflaud_jus_msg_place"); ?>"
}, function(ButtonPress, Value) {
if(ButtonPress == "<?= $this->lang->line("con_inflaud_jus_msg_btn_n"); ?>"){
return 0;
}else{
if(Value == ""){
notifica('<?= $this->lang->line("con_inflaud_msg_erro_title"); ?>', '<?= $this->lang->line("con_inflaud_jus_msg_inpmpt"); ?>', 4000);
}else{
$.ajax({
type: "POST",
url: "Controller/Funcao/" + $(t).attr('id') + "/0",
data: {justificativa: Value},
dataType: "json",
success: function(r) {
if(r) {
$(t).parent().parent().next().find('.msg_des').show();
$(t).parent().parent().next().find('.graf_lau').css('display','none');
$(t).parent().parent().next().find('blockquote > .graf_lau').css('display','block');
$(t).parent().parent().next().find('.img_lau_d').show();
$(t).parent().parent().next().find('.img_lau_a').css('display','none');
$(t).removeClass('desabilitar btn-danger');
$(t).addClass('habilitar btn-success');
$(t).empty();
$(t).append('<span class="btn-label"><i class="glyphicon glyphicon-ok"></i></span><?= $this->lang->line("view_inflaud_iten_btn_h"); ?>');
} else {
notifica('<?= $this->lang->line("con_inflaud_msg_erro_title"); ?>', '<?= $this->lang->line("con_inflaud_msg_erro_d"); ?>', 4000);
}
}
});
}
}
});
});