Revert "fix cancel button"

This reverts commit b649a16b46.
pull/65/head
justcool393 2022-12-13 21:11:42 -06:00
parent a9309096b4
commit 839a4b600b
3 changed files with 5 additions and 7 deletions

View File

@ -142,7 +142,7 @@ function post_reply(id){
document.getElementById('reply-form-body-'+id).value = ''
document.getElementById('message-reply-'+id).innerHTML = ''
toggleReplyBox('reply-to-c_'+id)
toggleReplyBox('reply-message-c_'+id)
const fileupload = document.getElementById('file-upload')
if (fileupload) {
fileupload.value = null;

View File

@ -539,10 +539,10 @@
<button type="button" class="btn btn-primary mr-3 {% if not c.author.is_muted %}d-none{% endif %}" id="unmute-user-{{c.id}}" onclick="postToastSwitch(this,'/unmute_user/{{c.author.id}}','mute-user-{{c.id}}','unmute-user-{{c.id}}','d-none')">Unmute</button>
{% endif %}
<button type="button" class="btn btn-primary nobackground" onclick="toggleReplyBox('reply-to-{{c.fullname}}')">Reply</button>
<button type="button" class="btn btn-primary nobackground" onclick="toggleReplyBox('reply-message-{{c.fullname}}')">Reply</button>
{# TODO: swap to comment_reply_box macro #}
<div id="reply-to-{{c.fullname}}" class="d-none">
<div id="reply-message-{{c.fullname}}" class="d-none">
<div id="comment-form-space-{{c.id}}" class="comment-write collapsed child">
<form id="reply-to-message-{{c.id}}" action="/reply" method="post" class="input-group" enctype="multipart/form-data">
<input type="hidden" name="formkey" value="{{v|formkey}}">
@ -558,7 +558,7 @@
{% endif %}
</div>
<button type="button" onclick="document.getElementById('reply-to-{{c.id}}').classList.add('d-none');remove_dialog()" class="btn btn-link text-muted ml-auto">Cancel</button>
<button type="button" onclick="document.getElementById('reply-message-{{c.id}}').classList.add('d-none');remove_dialog()" class="btn btn-link text-muted ml-auto">Cancel</button>
<button type="button" id="save-reply-to-{{c.id}}" class="btn btn-primary ml-2" onclick="post_reply('{{c.id}}');remove_dialog()">Reply</button>
</form>
<div id="message-reply-{{c.id}}" class="preview mt-2"></div>

View File

@ -136,9 +136,7 @@
{% endif %}
</div>
<button type="button" id="save-reply-to-{{target_fullname}}" form="reply-to-{{target_fullname}}" class="btn btn-primary text-whitebtn ml-auto fl-r" onclick="postComment('{{target_fullname}}', '{{hide}}');remove_dialog();">Comment</button>
{% if target_fullname.startswith('c_') %}
<button type="button" onclick="document.getElementById('reply-to-{{target_fullname}}').classList.add('d-none');remove_dialog()" class="btn btn-link text-muted ml-auto fl-r mr-3">Cancel</button>
{% endif %}
<button type="button" onclick="document.getElementById('reply-to-{{target_fullname}}').classList.add('d-none');remove_dialog()" class="btn btn-link text-muted ml-auto fl-r mr-3">Cancel</button>
</form>
<div id="form-preview-{{target_fullname}}" class="preview mb-3 mt-5"></div>
<div class="form-text text-small p-0 m-0"><a href="/formatting" {% if v and v.newtab %}data-target="t" target="_blank"{% endif %}>Formatting help</a></div>