Skip to content

Commit

Permalink
Merge pull request #383 from dekomote/dn/fix-related-objects-buttons
Browse files Browse the repository at this point in the history
Fix for related objects inline edit/delete buttons
  • Loading branch information
farridav authored Mar 27, 2022
2 parents d067e13 + b954aba commit 2aec53d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion jazzmin/static/jazzmin/js/change_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,15 @@
else if ($carousel.length) { handleCarousel($carousel); }
else if ($collapsible.length) { handleCollapsible($collapsible); }

applySelect2()
applySelect2();

$('body').on('change', '.related-widget-wrapper select', function(e) {
const event = $.Event('django:update-related');
$(this).trigger(event);
if (!event.isDefaultPrevented() && typeof(window.updateRelatedObjectLinks) !== 'undefined') {
updateRelatedObjectLinks(this);
}
});
});

// Apply select2 to all select boxes when new inline row is created
Expand Down

0 comments on commit 2aec53d

Please sign in to comment.