kopia lustrzana https://github.com/wagtail/wagtail
Adopt a standard data-chooser-modal-choice attribute to identify 'chosen' links
rodzic
b5746c386b
commit
b37d16b07b
|
@ -60,7 +60,6 @@ window.DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS =
|
|||
new DocumentChooserModalOnloadHandlerFactory({
|
||||
chooseStepName: 'chooser',
|
||||
chosenStepName: 'document_chosen',
|
||||
chosenLinkSelector: 'a.document-choice',
|
||||
searchFormSelector: 'form.document-search',
|
||||
searchFilterSelectors: ['#collection_chooser_collection_id'],
|
||||
searchInputDelay: 50,
|
||||
|
|
|
@ -2,7 +2,6 @@ import { ChooserModalOnloadHandlerFactory } from '../../includes/chooserModal';
|
|||
|
||||
window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS =
|
||||
new ChooserModalOnloadHandlerFactory({
|
||||
chosenLinkSelector: 'a.snippet-choice',
|
||||
searchFormSelector: 'form.snippet-search',
|
||||
searchFilterSelectors: ['#snippet-chooser-locale'],
|
||||
chosenResponseName: 'snippetChosen',
|
||||
|
|
|
@ -143,7 +143,8 @@ class ChooserModalOnloadHandlerFactory {
|
|||
constructor(opts) {
|
||||
this.chooseStepName = opts?.chooseStepName || 'choose';
|
||||
this.chosenStepName = opts?.chosenStepName || 'chosen';
|
||||
this.chosenLinkSelector = opts?.chosenLinkSelector || 'a[data-item-choice]';
|
||||
this.chosenLinkSelector =
|
||||
opts?.chosenLinkSelector || 'a[data-chooser-modal-choice]';
|
||||
this.paginationLinkSelector =
|
||||
opts?.paginationLinkSelector || '.pagination a';
|
||||
this.searchFormSelector = opts?.searchFormSelector || 'form[data-search]';
|
||||
|
|
|
@ -106,7 +106,7 @@ class BaseChooseView(View):
|
|||
"title",
|
||||
label=_("Title"),
|
||||
url_name="wagtaildocs:document_chosen",
|
||||
link_classname="document-choice",
|
||||
link_attrs={"data-chooser-modal-choice": True},
|
||||
),
|
||||
DownloadColumn("filename", label=_("File")),
|
||||
DateColumn("created_at", label=_("Created"), width="16%"),
|
||||
|
|
|
@ -101,7 +101,7 @@ class BaseChooseView(View):
|
|||
"title",
|
||||
self.model,
|
||||
label=_("Title"),
|
||||
link_classname="snippet-choice",
|
||||
link_attrs={"data-chooser-modal-choice": True},
|
||||
),
|
||||
],
|
||||
self.paginated_items,
|
||||
|
|
Ładowanie…
Reference in New Issue