mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add missing callback for attachment delete button (#5219)
This commit is contained in:
parent
a9a8ac1c70
commit
b3dcc28bd9
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user