Fixed delete modal not dismissed when clicking 'cancel' button.

This commit is contained in:
Fabio Caccamo
2018-10-11 12:08:35 +02:00
parent 47a3d66d5c
commit e3811e2609
+16
View File
@@ -0,0 +1,16 @@
(function($) {
'use strict';
$(function() {
$('.cancel-link').click(function(e) {
e.preventDefault();
var parentWindow = window.parent;
if (parentWindow && typeof(parentWindow.dismissRelatedObjectModal) === 'function') {
parentWindow.dismissRelatedObjectModal();
} else {
// fallback to default behavior
history.back();
}
return false;
});
});
})(django.jQuery);