Skip to content

Commit

Permalink
Account for situations in Wagtail 6+ where chooserUrls are not in the…
Browse files Browse the repository at this point in the history
… window object
  • Loading branch information
Brendan committed Jun 26, 2024
1 parent 7340585 commit 26fe4b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wagtailvideos/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ def editor_js():
return format_html(
"""
<script>
if (window.chooserUrls) {{
window.chooserUrls.videoChooser = '{0}';
}} else {{
window.chooserUrls = new Object();
window.chooserUrls.videoChooser = '{0}';
}}
</script>
""",
reverse('wagtailvideos_chooser:choose')
Expand Down

0 comments on commit 26fe4b4

Please sign in to comment.