Skip to content

Commit

Permalink
Improve integration with Django Debug Toolbar (#9213)
Browse files Browse the repository at this point in the history
  • Loading branch information
realsuayip authored Mar 7, 2024
1 parent 4c7c693 commit a2eabfc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rest_framework/static/rest_framework/js/ajax-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ function replaceDocument(docString) {

doc.write(docString);
doc.close();

if (window.djdt) {
// If Django Debug Toolbar is available, reinitialize it so that
// it can show updated panels from new `docString`.
window.addEventListener("load", djdt.init);
}
}

function doAjaxSubmit(e) {
Expand Down

0 comments on commit a2eabfc

Please sign in to comment.