Skip to content

Commit

Permalink
fix poll removing
Browse files Browse the repository at this point in the history
  • Loading branch information
mrilyew committed Nov 16, 2024
1 parent 890beb1 commit da3ba2d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VKAPI/Handlers/Wall.php
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ function edit(int $owner_id, int $post_id, string $message = "", string $attachm
$this->requireUser();
$this->willExecuteWriteAction();

$parsed_attachments = parseAttachments($attachments, ['photo', 'video', 'note', 'audio']);
$parsed_attachments = parseAttachments($attachments, ['photo', 'video', 'note', 'audio', 'poll']);
$final_attachments = [];
foreach($parsed_attachments as $attachment) {
if($attachment && !$attachment->isDeleted() && $attachment->canBeViewedBy($this->getUser()) &&
Expand Down
2 changes: 1 addition & 1 deletion Web/Presenters/InternalAPIPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function renderGetPhotosFromPost(int $owner_id, int $post_id) {
if($attachment instanceof \openvk\Web\Models\Entities\Photo)
{
$response[$attachment->getPrettyId()] = [
"url" => $attachment->getURLBySizeId('large'),
"url" => $attachment->getURLBySizeId('larger'),
"id" => $attachment->getPrettyId(),
];
}
Expand Down
1 change: 1 addition & 0 deletions Web/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2661,6 +2661,7 @@ a.poll-retract-vote {
overflow-x: hidden;
min-height: 300px;
width: 100%;
padding: 0px 2px;
}

.ovk-photo-view .ovk-photo-details {
Expand Down
10 changes: 9 additions & 1 deletion Web/static/js/al_wall.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,14 @@ u(document).on("click", "#editPost", async (e) => {
'preview': preview,
'id': aid
}, edit_place)
} else if(type == 'poll') {
__appendToTextarea({
'type': type,
'alignment': 'vertical',
'html': tr('poll'),
'id': att[type].id,
'undeletable': true,
}, edit_place)
} else {
const found_block = post.find(`div[data-att_type='${type}'][data-att_id='${aid}']`)
__appendToTextarea({
Expand Down Expand Up @@ -866,7 +874,7 @@ async function __appendToTextarea(attachment_obj, textareaNode) {
<div class='vertical-attachment-content' draggable="false">
${attachment_obj.html}
</div>
<div class='vertical-attachment-remove'>
<div class='${attachment_obj.undeletable ? 'lagged' : ''} vertical-attachment-remove'>
<div id='small_remove_button'></div>
</div>
</div>
Expand Down

0 comments on commit da3ba2d

Please sign in to comment.