mirror of
https://github.com/openvk/openvk
synced 2025-01-09 01:09:46 +03:00
Compare commits
2 commits
95a62f56e0
...
d365bb6b95
Author | SHA1 | Date | |
---|---|---|---|
|
d365bb6b95 | ||
|
43541b9136 |
5 changed files with 53 additions and 1 deletions
|
@ -261,3 +261,7 @@
|
|||
</div>
|
||||
|
||||
{/block}
|
||||
|
||||
{block bodyScripts}
|
||||
{script "js/al_despacito_wall.js"}
|
||||
{/block}
|
|
@ -711,3 +711,7 @@
|
|||
{include "banned.xml"}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block bodyScripts}
|
||||
{script "js/al_despacito_wall.js"}
|
||||
{/block}
|
|
@ -1,6 +1,6 @@
|
|||
<h4 n:if="$showTitle ?? true">{_comments} ({$count})</h4>
|
||||
|
||||
<div n:ifset="$thisUser">
|
||||
<div n:ifset="$thisUser" id="standaloneCommentBox">
|
||||
{var $commentsURL = "/al_comments/create/$model/" . $parent->getId()}
|
||||
{var $club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club}
|
||||
{if !$readOnly}
|
||||
|
|
|
@ -2300,3 +2300,20 @@ a.poll-retract-vote {
|
|||
background-image: url(/assets/packages/static/openvk/img/videoico.png);
|
||||
display: none;
|
||||
}
|
||||
|
||||
#standaloneCommentBox {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px dotted #8b8b8b;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.page_content.overscrolled div[class$="_small_block"] {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.page_content.overscrolled div[class$="_big_block"] {
|
||||
width: unset;
|
||||
}
|
27
Web/static/js/al_despacito_wall.js
Normal file
27
Web/static/js/al_despacito_wall.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
const contentPage = document.querySelector(".page_content");
|
||||
const rootElement = document.documentElement;
|
||||
|
||||
let smallBlockObserver = new IntersectionObserver(entries => {
|
||||
entries.forEach(x => {
|
||||
window.requestAnimationFrame(() => {
|
||||
let pastHeight = contentPage.getBoundingClientRect().height;
|
||||
if(x.isIntersecting)
|
||||
contentPage.classList.remove("overscrolled");
|
||||
else
|
||||
contentPage.classList.add("overscrolled");
|
||||
|
||||
let currentHeight = contentPage.getBoundingClientRect().height;
|
||||
let ratio = currentHeight / pastHeight;
|
||||
|
||||
rootElement.scrollTop *= ratio;
|
||||
}, contentPage);
|
||||
});
|
||||
}, {
|
||||
root: null, // screen
|
||||
rootMargin: "0px",
|
||||
threshold: 0
|
||||
});
|
||||
|
||||
let smol = document.querySelector('div[class$="_small_block"]');
|
||||
if(smol != null)
|
||||
smallBlockObserver.observe(smol);
|
Loading…
Reference in a new issue