mirror of
https://github.com/openvk/openvk
synced 2024-11-15 11:39:13 +03:00
Photo: The Fxck Is This implementation of comments under photo in viewer
This commit is contained in:
parent
b898baeadb
commit
33997ce81f
2 changed files with 22 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
|||
|
||||
<hr/>
|
||||
|
||||
<div style="width: 100%; min-height: 100px;">
|
||||
<div style="width: 100%; min-height: 100px;" class="ovk-photo-details">
|
||||
<div style="float: left; min-height: 100px; width: 70%;">
|
||||
{include "../components/comments.xml", comments => $comments, count => $cCount, page => $cPage, model => "photos", parent => $photo}
|
||||
</div>
|
||||
|
|
|
@ -188,8 +188,11 @@ function OpenMiniature(e, photo, post, photo_id) {
|
|||
<center style="margin-bottom: 8pt;">
|
||||
<div class="ovk-photo-slide-left"></div>
|
||||
<div class="ovk-photo-slide-right"></div>
|
||||
<img src="${photo}" style="max-width: 80%; max-height: 60vh;" id="ovk-photo-img">
|
||||
<img src="${photo}" style="max-width: 100%; max-height: 60vh;" id="ovk-photo-img">
|
||||
</center>
|
||||
<div class="ovk-photo-details">
|
||||
<img src="/assets/packages/static/openvk/img/loading_mini.gif">
|
||||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
u("body").addClass("dimmed").append(dialog);
|
||||
|
@ -265,6 +268,23 @@ function OpenMiniature(e, photo, post, photo_id) {
|
|||
}
|
||||
});
|
||||
|
||||
ky("/photo" + photo_id, {
|
||||
hooks: {
|
||||
afterResponse: [
|
||||
async (_request, _options, response) => {
|
||||
let parser = new DOMParser();
|
||||
let body = parser.parseFromString(await response.text(), "text/html");
|
||||
|
||||
let element = u(body.getElementsByClassName("ovk-photo-details")).last();
|
||||
|
||||
u(".ovk-photo-details").last().innerHTML = element.innerHTML;
|
||||
|
||||
u("#photo_com_title_photos").last().innerHTML = "Фотография " + imagesIndex + " из " + imagesCount;
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
return u(".ovk-photo-view-dimmer");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue