Pass icon to AdminSnippetChooser in SnippetViewSet.register_chooser_widget()

This effectively sets the chooser widget icon to use SnippetViewSet.icon
pull/10255/head
Sage Abdullah 2023-03-09 15:20:12 +00:00 zatwierdzone przez Matt Westcott
rodzic def6723a21
commit dd54899ec8
2 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -72,4 +72,4 @@ class SnippetChooserViewSet(ChooserViewSet):
@cached_property
def widget_class(self):
return AdminSnippetChooser(model=self.model)
return AdminSnippetChooser(model=self.model, icon=self.icon)

Wyświetl plik

@ -13,7 +13,6 @@ from wagtail.telepath import register
class AdminSnippetChooser(BaseChooser):
display_title_key = "string"
icon = "snippet"
classname = "snippet-chooser"
js_constructor = "SnippetChooser"