Add missing callback for attachment delete button (#5219) (#5220)

(cherry picked from commit b3dcc28bd9)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2023-07-11 11:30:57 +10:00 committed by GitHub
parent feb2acf668
commit cf5d637678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -281,10 +281,20 @@ function loadAttachmentTable(url, options) {
sidePagination: 'server',
onPostBody: function() {
// Add callback for 'delete' button
if (permissions.delete) {
$(table).find('.button-attachment-delete').click(function() {
let pk = $(this).attr('pk');
let attachments = $(table).bootstrapTable('getRowByUniqueId', pk);
deleteAttachments([attachments], url, options);
});
}
// Add callback for 'edit' button
if (permissions.change) {
$(table).find('.button-attachment-edit').click(function() {
var pk = $(this).attr('pk');
let pk = $(this).attr('pk');
constructForm(`${url}${pk}/`, {
fields: {