mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
fix poll removing
This commit is contained in:
parent
890beb1ce7
commit
da3ba2df0b
4 changed files with 12 additions and 3 deletions
|
@ -953,7 +953,7 @@ final class Wall extends VKAPIRequestHandler
|
||||||
$this->requireUser();
|
$this->requireUser();
|
||||||
$this->willExecuteWriteAction();
|
$this->willExecuteWriteAction();
|
||||||
|
|
||||||
$parsed_attachments = parseAttachments($attachments, ['photo', 'video', 'note', 'audio']);
|
$parsed_attachments = parseAttachments($attachments, ['photo', 'video', 'note', 'audio', 'poll']);
|
||||||
$final_attachments = [];
|
$final_attachments = [];
|
||||||
foreach($parsed_attachments as $attachment) {
|
foreach($parsed_attachments as $attachment) {
|
||||||
if($attachment && !$attachment->isDeleted() && $attachment->canBeViewedBy($this->getUser()) &&
|
if($attachment && !$attachment->isDeleted() && $attachment->canBeViewedBy($this->getUser()) &&
|
||||||
|
|
|
@ -122,7 +122,7 @@ final class InternalAPIPresenter extends OpenVKPresenter
|
||||||
if($attachment instanceof \openvk\Web\Models\Entities\Photo)
|
if($attachment instanceof \openvk\Web\Models\Entities\Photo)
|
||||||
{
|
{
|
||||||
$response[$attachment->getPrettyId()] = [
|
$response[$attachment->getPrettyId()] = [
|
||||||
"url" => $attachment->getURLBySizeId('large'),
|
"url" => $attachment->getURLBySizeId('larger'),
|
||||||
"id" => $attachment->getPrettyId(),
|
"id" => $attachment->getPrettyId(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -2661,6 +2661,7 @@ a.poll-retract-vote {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding: 0px 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ovk-photo-view .ovk-photo-details {
|
.ovk-photo-view .ovk-photo-details {
|
||||||
|
|
|
@ -722,6 +722,14 @@ u(document).on("click", "#editPost", async (e) => {
|
||||||
'preview': preview,
|
'preview': preview,
|
||||||
'id': aid
|
'id': aid
|
||||||
}, edit_place)
|
}, edit_place)
|
||||||
|
} else if(type == 'poll') {
|
||||||
|
__appendToTextarea({
|
||||||
|
'type': type,
|
||||||
|
'alignment': 'vertical',
|
||||||
|
'html': tr('poll'),
|
||||||
|
'id': att[type].id,
|
||||||
|
'undeletable': true,
|
||||||
|
}, edit_place)
|
||||||
} else {
|
} else {
|
||||||
const found_block = post.find(`div[data-att_type='${type}'][data-att_id='${aid}']`)
|
const found_block = post.find(`div[data-att_type='${type}'][data-att_id='${aid}']`)
|
||||||
__appendToTextarea({
|
__appendToTextarea({
|
||||||
|
@ -866,7 +874,7 @@ async function __appendToTextarea(attachment_obj, textareaNode) {
|
||||||
<div class='vertical-attachment-content' draggable="false">
|
<div class='vertical-attachment-content' draggable="false">
|
||||||
${attachment_obj.html}
|
${attachment_obj.html}
|
||||||
</div>
|
</div>
|
||||||
<div class='vertical-attachment-remove'>
|
<div class='${attachment_obj.undeletable ? 'lagged' : ''} vertical-attachment-remove'>
|
||||||
<div id='small_remove_button'></div>
|
<div id='small_remove_button'></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue