Skip to content

Commit

Permalink
Fixing django32 pop-up closing issue. (#191)
Browse files Browse the repository at this point in the history
* fix: django32 has removed `windowname_to_id` function but it is breaking sorted-m2m usage on pop-up.
  • Loading branch information
awais786 authored Sep 27, 2021
1 parent 5d60701 commit d38cb83
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sortedm2m/static/sortedm2m/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ if (typeof jQuery === 'undefined') {
return text;
}

function windowname_to_id(text) {
// django32 has removed windowname_to_id function.
text = text.replace(/__dot__/g, '.');
text = text.replace(/__dash__/g, '-');
return text;
}

if (window.showAddAnotherPopup) {
var django_dismissAddAnotherPopup = window[dismissPopupFnName];
window[dismissPopupFnName] = function (win, newId, newRepr) {
Expand Down

0 comments on commit d38cb83

Please sign in to comment.