10000 fix: Redirects to newly created object by fsbraun · Pull Request #7864 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

fix: Redirects to newly created object #7864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 4, 2024
Prev Previous commit
Next Next commit
Remove cosole.logs
  • Loading branch information
fsbraun committed Jan 11, 2024
commit faa71b768d838ef365c632f6b08b677be7a78eab
13 changes: 4 additions & 9 deletions cms/static/cms/js/modules/cms.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,15 +911,10 @@ class Modal {
}

// check if we are redirected - should only happen after successful form submission
var redirect = body.find('a.cms-view-new-object');
console.log(body.html() + " - " + redirect.attr('href') + " - " + redirect.length);
if (redirect.length > 0) {
var url = redirect.attr('href');
console.log("Url: " + url);
if (url) {
Helpers.reloadBrowser(redirect.attr('href'), false);
return true;
}
var redirect = body.find('a.cms-view-new-object').attr("href");
if (redirect) {
Helpers.reloadBrowser(redirect, false);
return true;
}


Expand Down
0