Skip to content

Commit

Permalink
Fixed a bug with deleting a model from changelist inside modal
Browse files Browse the repository at this point in the history
  • Loading branch information
vxsx committed Sep 23, 2018
1 parent dd593e5 commit f325d43
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -20,6 +20,7 @@
url on save.
* Fixed a bug where setting the ``on_delete`` option on ``PlaceholderField``
and ``PageField`` fields would be ignored.
* Fixed a bug when deleting a modal from changelist inside a modal


=== 3.5.2 (2018-04-11) ===
Expand Down
2 changes: 1 addition & 1 deletion cms/static/cms/js/dist/3.5.2/bundle.toolbar.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions cms/static/cms/js/modules/cms.modal.js
Expand Up @@ -776,10 +776,12 @@ class Modal {

var action = item.closest('form').prop('action');

if (action.match(/delete-plugin/)) {
// in case action is an input (see https://github.com/jquery/jquery/issues/3691)
// it's definitely not a plugin/placeholder deletion
if (typeof action === 'string' && action.match(/delete-plugin/)) {
that.justDeletedPlugin = /delete-plugin\/(\d+)\//gi.exec(action)[1];
}
if (action.match(/clear-placeholder/)) {
if (typeof action === 'string' && action.match(/clear-placeholder/)) {
that.justDeletedPlaceholder = /clear-placeholder\/(\d+)\//gi.exec(action)[1];
}
}
Expand Down

0 comments on commit f325d43

Please sign in to comment.