mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Explicitly list widget JS in FooChooserAdapter media
This is necessary (according to the logic for adding Django form media objects together) whenever the JS adapter definition depends on anything defined in the widget JS - e.g. if foo-chooser.js defines `window.FooChooser`, and foo-chooser-telepath.js references that in the definition of FooChooserAdapter, then the only way to guarantee the correct ordering is with an explicit `['foo-chooser.js', 'foo-chooser-telepath.js']` media definition - adding two media objects does not guarantee this ordering.
This commit is contained in:
parent
7a1ae9f16b
commit
f8c8bf06ba
@ -175,6 +175,8 @@ class DocumentChooserAdapter(BaseChooserAdapter):
|
||||
def media(self):
|
||||
return forms.Media(
|
||||
js=[
|
||||
versioned_static("wagtaildocs/js/document-chooser-modal.js"),
|
||||
versioned_static("wagtaildocs/js/document-chooser.js"),
|
||||
versioned_static("wagtaildocs/js/document-chooser-telepath.js"),
|
||||
]
|
||||
)
|
||||
|
@ -59,6 +59,8 @@ class ImageChooserAdapter(BaseChooserAdapter):
|
||||
def media(self):
|
||||
return forms.Media(
|
||||
js=[
|
||||
versioned_static("wagtailimages/js/image-chooser-modal.js"),
|
||||
versioned_static("wagtailimages/js/image-chooser.js"),
|
||||
versioned_static("wagtailimages/js/image-chooser-telepath.js"),
|
||||
]
|
||||
)
|
||||
|
@ -65,6 +65,8 @@ class SnippetChooserAdapter(BaseChooserAdapter):
|
||||
def media(self):
|
||||
return forms.Media(
|
||||
js=[
|
||||
versioned_static("wagtailadmin/js/chooser-modal.js"),
|
||||
versioned_static("wagtailsnippets/js/snippet-chooser.js"),
|
||||
versioned_static("wagtailsnippets/js/snippet-chooser-telepath.js"),
|
||||
]
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user