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

pull/49/head
Fabio Caccamo 2018-10-11 12:08:35 +02:00
parent 47a3d66d5c
commit e3811e2609
1 changed files with 16 additions and 0 deletions

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);