Compare commits

..

3 commits

Author SHA1 Message Date
lalka2016
77d0603e67 Remove javascript positioning🤮🤮🤮 2023-08-11 17:31:46 +03:00
lalka2016
553731deed Fix scroll 2023-08-11 14:14:36 +03:00
lalka2016
8bccab7bc0 Newlines and fix textareas 2023-08-11 12:37:25 +03:00
9 changed files with 39 additions and 33 deletions

View file

@ -35,7 +35,7 @@ final class SearchPresenter extends OpenVKPresenter
$invert = $this->queryParam("invert") == 1 ? "ASC" : "DESC";
$page = (int) ($this->queryParam("p") ?? 1);
$this->willExecuteWriteAction();
# $this->willExecuteWriteAction();
if($query != "")
$this->assertUserLoggedIn();

View file

@ -149,11 +149,10 @@
]}
{/if}
</div>
<p style="margin-left: 15px; margin-top: 0;">
<p style="margin-left: 15px; {if $thisUser->getPaginatorType() == 1}margin-top: 14px;{/if}">
<b>{tr("results", $count)}</b>
</p>
<div>
{include searchOptions}
<div style="display: flex;flex-direction: row;">
{var $data = is_array($iterator) ? $iterator : iterator_to_array($iterator)}
<div class="container_gray borderup infContainer" style="float:left;width:73.3%;">
@ -231,12 +230,7 @@
]}
{/if}
</div>
<script>
window.addEventListener("load", (event) => {
document.getElementsByClassName("container_gray")[0].style.minHeight = document.getElementsByClassName("searchOptions")[0].clientHeight+"px";
document.getElementsByClassName("searchOptions")[0].style.minHeight = document.getElementsByClassName("container_gray")[0].clientHeight-3+"px";
})
</script>
{include searchOptions}
{/block}
{block searchOptions}

View file

@ -51,7 +51,7 @@
{include "../components/paginator.xml", conf => $paginatorConf}
{/if}
<script>
<script n:if="$thisUser->getPaginatorType() == 0">
u("#pageSelect").nodes[0].value = {$paginatorConf->perPage};
u("#pageSelect").on("change", function(e) {

View file

@ -2,4 +2,4 @@
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage) && $conf->page < $pageCount" class="showMore" data-pageсount="{$pageCount}" data-page="{$conf->page}">
{_show_more}
</div>
</div>

View file

@ -3,7 +3,7 @@
<div id="write" style="padding: 5px 0;" onfocusin="expand_wall_textarea({$textAreaId});">
<form action="{$route}" method="post" enctype="multipart/form-data" style="margin:0;">
<textarea id="wall-post-input{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea>
<textarea id="wall-post-input{$textAreaId}" data-id="{$textAreaId}" placeholder="{_write}" name="text" style="width: 100%;resize: none;" class="small-textarea"></textarea>
<div>
<!-- padding to fix <br/> bug -->
</div>

View file

@ -2319,7 +2319,7 @@ a.poll-retract-vote {
float:right;
scrollbar-width: none;
font-size:12px;
background-color:#f7f7f7;
background-color:#F6F6F6;
margin-right: -7px;
}
@ -2697,22 +2697,9 @@ body.article .floating_sidebar, body.article .page_content {
font-size: 12px;
}
.small_red_button {
float: right;
font-weight: bold;
}
.small_red_button a {
color: #B0B0B0;
}
.small_red_button a:hover {
color: #a7a7a7;
}
.showMore {
text-align: center;
padding-top: 10px;
padding-bottom: 10px;
cursor: pointer;
}
}

View file

@ -44,4 +44,4 @@ tippy(".mention", {
});
}
initMentions()
initMentions()

View file

@ -272,9 +272,11 @@ async function showArticle(note_id) {
$(document).on("click", ".showMore", async (e) => {
e.currentTarget.innerHTML = `<img id="loader" src="/assets/packages/static/openvk/img/loading_mini.gif">`
let url = new URL(location.href)
let newPage = Number(e.currentTarget.dataset.page) + 1
url.searchParams.set("p", newPage)
url.searchParams.set("posts", 10)
let xhr = new XMLHttpRequest
xhr.open("GET", url)
@ -305,6 +307,16 @@ $(document).on("click", ".showMore", async (e) => {
for(const obj of objects) {
container.insertAdjacentHTML("beforeend", obj.outerHTML)
}
if(result.querySelectorAll("textarea").length > 0) {
for(const trea of result.querySelectorAll("textarea")) {
setupWallPostInputHandlers(trea.dataset.id)
u("#post-buttons" + trea.dataset.id + " .postFileSel").on("change", function() {
handleUpload.bind(this, trea.dataset.id)();
});
}
}
bsdnHydrate()
@ -318,3 +330,20 @@ $(document).on("click", ".showMore", async (e) => {
xhr.send()
})
let showMoreObserver = new IntersectionObserver(entries => {
entries.forEach(x => {
if(x.isIntersecting) {
$(".showMore").click()
}
})
}, {
root: null,
rootMargin: "0px",
threshold: 0
})
let showMore = document.querySelector('.showMore');
if(showMore != null)
showMoreObserver.observe(showMore);

View file

@ -691,8 +691,4 @@ $(document).on("scroll", () => {
$(".floating_sidebar")[0].classList.remove("hide_anim");
}, 250);
}
if($(window).scrollTop() == $(document).height() - $(window).height() && document.querySelector(".showMore") != null) {
$(".showMore").click()
}
})