quick-post-controls.js: fix undefined board parameter

This commit is contained in:
Zankaria 2024-08-24 00:47:18 +02:00
parent 3453ff5aed
commit f8bbb13609

View file

@ -15,7 +15,7 @@
$(document).ready(function() { $(document).ready(function() {
let open_form = function() { let open_form = function() {
let thread = $(this).parent().parent().hasClass('op'); let thread = $(this).parent().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) {
@ -28,18 +28,18 @@ $(document).ready(function() {
'<label for="password_' + id + '">'+_("Password")+'</label>: ' + '<label for="password_' + id + '">'+_("Password")+'</label>: ' +
'<input id="password_' + id + '" type="password" name="password" size="11" maxlength="18">' + '<input id="password_' + id + '" type="password" name="password" size="11" maxlength="18">' +
'<input title="'+_('Delete file only')+'" type="checkbox" name="file" id="delete_file_' + id + '">' + '<input title="'+_('Delete file only')+'" type="checkbox" name="file" id="delete_file_' + id + '">' +
'<label for="delete_file_' + id + '">' + _('File') + '</label>' + '<label for="delete_file_' + id + '">'+_('File')+'</label>' +
' <input type="submit" name="delete" value="' + _('Delete') + '">' + ' <input type="submit" name="delete" value="'+_('Delete')+'">' +
'<br>' + '<br>' +
'<label for="reason_' + id + '">' + _('Reason') + '</label>: ' + '<label for="reason_' + id + '">'+_('Reason')+'</label>: ' +
'<input id="reason_' + id + '" type="text" name="reason" size="20" maxlength="100">' + '<input id="reason_' + id + '" type="text" name="reason" size="20" maxlength="100">' +
' <input type="submit" name="report" value="' + _('Report') + '">' + ' <input type="submit" name="report" value="' + _('Report') + '">' +
'</div>' + '</div>' +
'</form>'); '</form>');
let board = $(this).parent().parent().parent().attr("data-board"); let board = $(this).parent().parent().parent().parent().attr("data-board");
if ($('form[name="post"]:first').length) { if ($('form[name="post"]:first').length) {
post_form post_form
.attr('action', $('form[name="post"]:first').attr('action')) .attr('action', $('form[name="post"]:first').attr('action'))