quick-post-controls.js: port to new html structure

This commit is contained in:
Zankaria 2024-08-24 00:47:18 +02:00 committed by Zankaria
parent e4a8757a3d
commit 210423ec0a

View File

@ -14,13 +14,11 @@
$(document).ready(function() { $(document).ready(function() {
let open_form = function() { let open_form = function() {
let thread = $(this).parent().parent().hasClass('op');
let id = $(this).attr('name').match(/^delete_(\d+)$/)[1]; let id = $(this).attr('name').match(/^delete_(\d+)$/)[1];
if (this.checked) { if (this.checked) {
let post_form = $('<form class="post-actions" method="post" style="margin:10px 0 0 0">' + let post_form = $('<form class="post-actions" method="post" style="margin:10px 0 0 0">' +
'<div style="text-align:right">' + '<div style="text-align:right"><hr>' +
(!thread ? '<hr>' : '') +
'<input type="hidden" name="delete_' + id + '">' + '<input type="hidden" name="delete_' + id + '">' +
@ -57,11 +55,7 @@ $(document).ready(function() {
post_form.find('input[type="password"]').val(localStorage.password); post_form.find('input[type="password"]').val(localStorage.password);
if (thread) {
post_form.prependTo($(this).parent().parent().find('div.body'));
} else {
post_form.appendTo($(this).parent().parent()); post_form.appendTo($(this).parent().parent());
}
$(window).trigger('quick-post-controls', post_form); $(window).trigger('quick-post-controls', post_form);
} else { } else {