Skip to content

Commit 2aec53d

Browse files
authored
Merge pull request #383 from dekomote/dn/fix-related-objects-buttons
Fix for related objects inline edit/delete buttons
2 parents d067e13 + b954aba commit 2aec53d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

jazzmin/static/jazzmin/js/change_form.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,15 @@
134134
else if ($carousel.length) { handleCarousel($carousel); }
135135
else if ($collapsible.length) { handleCollapsible($collapsible); }
136136

137-
applySelect2()
137+
applySelect2();
138+
139+
$('body').on('change', '.related-widget-wrapper select', function(e) {
140+
const event = $.Event('django:update-related');
141+
$(this).trigger(event);
142+
if (!event.isDefaultPrevented() && typeof(window.updateRelatedObjectLinks) !== 'undefined') {
143+
updateRelatedObjectLinks(this);
144+
}
145+
});
138146
});
139147

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

0 commit comments

Comments
 (0)