1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-12 15:44:07 +01:00

Fix ricerca in piano dei conti

This commit is contained in:
Pek5892 2024-02-23 15:14:00 +01:00
parent 4633113022
commit 5c7f5cc712

View File

@ -103,8 +103,8 @@ foreach ($primo_livello as $conto_primo) {
</div> </div>
<h5> <h5>
<button type="button" id="conto3-'.$conto_secondo['id'].'" class="btn btn-default btn-xs plus-btn search"><i class="fa fa-plus"></i></button> <button type="button" id="conto2-'.$conto_secondo['id'].'" class="btn btn-default btn-xs plus-btn search"><i class="fa fa-plus"></i></button>
<span class="clickable" id="conto3-'.$conto_secondo['id'].'"> <span class="clickable" id="conto2-'.$conto_secondo['id'].'">
<b>'.$conto_secondo['numero'].' '.$conto_secondo['descrizione'].'</b> <b>'.$conto_secondo['numero'].' '.$conto_secondo['descrizione'].'</b>
</span> </span>
<div id="conto2_'.$conto_secondo['id'].'" style="display:none;"></div> <div id="conto2_'.$conto_secondo['id'].'" style="display:none;"></div>
@ -288,22 +288,7 @@ echo '
} }
}); });
$("button[id^=conto3-]").each(function() { $("button[id^=conto2-]").each(function() {
$(this).on("click", function() {
let conto3 = $(this).parent().find("div[id^=conto2_]");
if(!conto3.html()) {
let id_conto = $(this).attr("id").split("-").pop();
caricaConti3(conto3.attr("id"), id_conto);
} else {
conto3.slideToggle();
}
$(this).parent().find(".plus-btn i").toggleClass("fa-plus").toggleClass("fa-minus");
});
});
$("span[id^=conto3-]").each(function() {
$(this).on("click", function() { $(this).on("click", function() {
let conto3 = $(this).parent().find("div[id^=conto2_]"); let conto3 = $(this).parent().find("div[id^=conto2_]");
@ -341,11 +326,6 @@ echo '
$("#" + selector).html(data) $("#" + selector).html(data)
.slideToggle(); .slideToggle();
if ($("#input-cerca").data("search-in-progress") == "1") {
$("#button-search").trigger("click");
$("#input-cerca").data("search-in-progress", "0");
}
$("#main_loading").fadeOut(); $("#main_loading").fadeOut();
} }
}); });
@ -357,7 +337,6 @@ echo '
$("#button-search").on("click", function(){ $("#button-search").on("click", function(){
var text = $("#input-cerca").val(); var text = $("#input-cerca").val();
if (text != "") $("#input-cerca").data("search-in-progress", "1");
$.ajax({ $.ajax({
url: globals.rootdir + "/actions.php", url: globals.rootdir + "/actions.php",