Current Path : /data/web/virtuals/51568/virtual/www/www/hledej/ |
Current File : /data/web/virtuals/51568/virtual/www/www/hledej/hledej.js |
<script> function hledej(){ let hledam = $("#hledej-input").val().trim(); if (hledam){ $.ajax({ url: "www/hledej/hledej.php", type: 'POST', data: { 'hledam': hledam, }, success: function (result) { if (result){ $("#main-page").html(result); } } }) } } function ukazNalezeno(id){ let sipka = $("#row-prispevek-hledej" + id).attr("row-state"), typ = $("#row-prispevek-hledej" + id).attr("hledej-typ"); if (sipka == '0') { if (typ == 'm') { $.ajax({ url: "www/clanky/clanek-z-menu.php", type: 'POST', data: { 'data': JSON.stringify({ command: 'zobrazClanek', id: id, }) }, success: function (result) { if (result){ $("[id^='sipka-prispevek-hledej']").html('<i class="fas fa-chevron-down">'); $("[id^='div-prispevek-hledej']").css('display', 'none').html(""); $("[id^='row-prispevek-hledej']").attr("row-state", 0); $("#div-prispevek-hledej" + id).html(result).slideDown(600); $("#div-nalezeno").html(result); $("#sipka-prispevek-hledej" + id).html('<i class="fas fa-chevron-up">'); $("#row-prispevek-hledej" + id).attr("row-state", 1); } } }) } if (typ == 'x') { $.ajax({ url: "www/clanky/clanek-ukaz.php", type: 'POST', data: { id: id, zpet: 0, }, success: function (result) { if (result){ $("[id^='sipka-prispevek-hledej']").html('<i class="fas fa-chevron-down">'); $("[id^='div-prispevek-hledej']").css('display', 'none').html(""); $("[id^='row-prispevek-hledej']").attr("row-state", 0); $("#div-prispevek-hledej" + id).html(result).slideDown(600); $("#div-nalezeno").html(result); $("#sipka-prispevek-hledej" + id).html('<i class="fas fa-chevron-up">'); $("#row-prispevek-hledej" + id).attr("row-state", 1); } } }) } } else { $("#sipka-prispevek-hledej" + id).html('<i class="fas fa-chevron-down">'); $("#div-prispevek-hledej" + id).slideUp(600); $("#row-prispevek-hledej" + id).attr("row-state", 0); } } </script>