mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
fix hidePanel's count argument
This commit is contained in:
parent
c07576188d
commit
4507c8cb33
3 changed files with 13 additions and 10 deletions
|
@ -21,7 +21,7 @@ final class AdminPresenter extends OpenVKPresenter
|
|||
$query = $this->queryParam("q") ?? "";
|
||||
$page = (int) ($this->queryParam("p") ?? 1);
|
||||
|
||||
$count = $repo->getFoundCount($query);
|
||||
$count = $repo->findCount($query);
|
||||
return $repo->find($query, $page);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue