Skip to content

Support JS events when loading a panel. #1441

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 3 commits into from
Apr 19, 2021
Merged

Support JS events when loading a panel. #1441

merged 3 commits into from
Apr 19, 2021

Conversation

tim-schilling
Copy link
Member

This fixes the problem of the Timer Panel not inserting the browser
timings section after being loaded via the HistoryPanel.

These events could be wired into to better render panels or support
a more dynamic toolbar and/or panel.

Fixes #1439

This fixes the problem of the Timer Panel not inserting the browser
timings section after being loaded via the HistoryPanel.

These events could be wired into to better render panels or support
a more dynamic toolbar and/or panel.
@matthiask matthiask requested a review from jdufresne January 23, 2021 20:11
@matthiask
Copy link
Member

I think I like it.

@jdufresne I requested a review because you added the new panel loading code; please feel free to skip this if you don't find the time or energy for a review!

@tim-schilling
Copy link
Member Author

tim-schilling commented Jan 23, 2021 via email

This fixes the problem of the Timer Panel not inserting the browser
timings section after being loaded via the HistoryPanel.

These events could be wired into to better render panels or support
a more dynamic toolbar and/or panel.
@codecov
Copy link

codecov bot commented Jan 24, 2021

Codecov Report

Merging #1441 (6bd557c) into main (5a3ccd9) will increase coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1441      +/-   ##
==========================================
+ Coverage   86.33%   86.50%   +0.16%     
==========================================
  Files          34       34              
  Lines        1852     1852              
  Branches      260      260              
==========================================
+ Hits         1599     1602       +3     
+ Misses        181      178       -3     
  Partials       72       72              
Impacted Files Coverage Δ
debug_toolbar/panels/__init__.py 95.38% <ø> (ø)
debug_toolbar/panels/profiling.py 89.28% <0.00%> (+2.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a3ccd9...64d928f. Read the comment docs.

@tim-schilling
Copy link
Member Author

I changed the approach to put the responsibility of handling the async nature of a panel's scripts on the panel's script rather than toolbar.js. I also changed the functionality to operate on rendering rather than ajax loading. I figured this would be more flexible in the future.

These commits should be squashed before merging (if approved).

Base automatically changed from master to main February 11, 2021 15:01
@matthiask matthiask removed the request for review from jdufresne March 6, 2021 16:31
@matthiask
Copy link
Member

This looks good I think. @tim-schilling Do you think it's ready to merge or is there anything left to do here?

@tim-schilling tim-schilling merged commit 7f2ad72 into django-commons:main Apr 19, 2021
@tim-schilling tim-schilling deleted the javascript-load-panel-event branch April 19, 2021 13:35
@tim-schilling
Copy link
Member Author

Thanks for the reviews folks. Squashed and merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time panel doesn't re-run timer.js for new requests
3 participants