Skip to content

Commit

Permalink
Ottimizzazione ricerca piano dei conti
Browse files Browse the repository at this point in the history
  • Loading branch information
Pek5892 committed Apr 6, 2023
1 parent 0e0abd6 commit a3f6ca5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/partitario/edit.php
Expand Up @@ -282,6 +282,12 @@
<script>
$(document).ready(function() {
$("#input-cerca").keyup(function(key) {
if (key.which == 13) {
$("#button-search").click();
}
});
$("button[id^=conto3-]").each(function() {
$(this).on("click", function() {
let conto3 = $(this).parent().find("div[id^=conto2_]");
Expand Down Expand Up @@ -335,6 +341,11 @@ function caricaConti3(selector, id_conto) {
$("#" + selector).html(data)
.slideToggle();
if ($("#input-cerca").data("search-in-progress") == "1") {
$("#button-search").trigger("click");
$("#input-cerca").data("search-in-progress", "0");
}
$("#main_loading").fadeOut();
}
});
Expand All @@ -346,7 +357,8 @@ function aggiornaReddito(id_conto){
$("#button-search").on("click", function(){
var text = $("#input-cerca").val();
if (text != "") $("#input-cerca").data("search-in-progress", "1");
$.ajax({
url: globals.rootdir + "/actions.php",
type: "POST",
Expand Down

0 comments on commit a3f6ca5

Please sign in to comment.