fix hidePanel's count argument

This commit is contained in:
veselcraft 2020-12-26 03:06:20 -05:00
parent c07576188d
commit 4507c8cb33
3 changed files with 13 additions and 10 deletions

View file

@ -21,7 +21,7 @@ final class AdminPresenter extends OpenVKPresenter
$query = $this->queryParam("q") ?? ""; $query = $this->queryParam("q") ?? "";
$page = (int) ($this->queryParam("p") ?? 1); $page = (int) ($this->queryParam("p") ?? 1);
$count = $repo->getFoundCount($query); $count = $repo->findCount($query);
return $repo->find($query, $page); return $repo->find($query, $page);
} }

View file

@ -1,5 +1,5 @@
<div class="content_divider"> <div class="content_divider">
<div class="content_title_expanded" onclick="hidePanel(this, {$count});"> <div class="content_title_expanded" onclick="hidePanel(this);">
{_"wall"} <nobold>{tr("wall", $count)}</nobold> {_"wall"} <nobold>{tr("wall", $count)}</nobold>
</div> </div>
<div> <div>

View file

@ -22,15 +22,18 @@ function edit_post(id, wid) {
} }
function hidePanel(panel, count = 0)
{
$(panel).toggleClass("content_title_expanded content_title_unexpanded");
$(panel).next('div').slideToggle(300);
if(count != 0){
if($(panel).hasClass("content_title_expanded"))
$(panel).html($(panel).html().replaceAll(" ("+count+")", ""));
else
$(panel).html($(panel).html() + " ("+count+")");
}
}
$(function () {
$('.content_title_expanded').click(function(){
$(this).toggleClass("content_title_expanded content_title_unexpanded");
$(this).next('div').slideToggle(300);
});});
document.addEventListener("DOMContentLoaded", function() { //BEGIN document.addEventListener("DOMContentLoaded", function() { //BEGIN