kopia lustrzana https://github.com/wagtail/wagtail
Adopt a standard data-chooser-modal-search attribute to identify the search form
rodzic
b958585ff8
commit
b45d2a0973
|
@ -58,7 +58,6 @@ class DocumentChooserModalOnloadHandlerFactory extends ChooserModalOnloadHandler
|
|||
|
||||
window.DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS =
|
||||
new DocumentChooserModalOnloadHandlerFactory({
|
||||
searchFormSelector: 'form.document-search',
|
||||
searchFilterSelectors: ['#collection_chooser_collection_id'],
|
||||
searchInputDelay: 50,
|
||||
chosenResponseName: 'documentChosen',
|
||||
|
|
|
@ -2,7 +2,6 @@ import { ChooserModalOnloadHandlerFactory } from '../../includes/chooserModal';
|
|||
|
||||
window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS =
|
||||
new ChooserModalOnloadHandlerFactory({
|
||||
searchFormSelector: 'form.snippet-search',
|
||||
searchFilterSelectors: ['#snippet-chooser-locale'],
|
||||
chosenResponseName: 'snippetChosen',
|
||||
}).getOnLoadHandlers();
|
||||
|
|
|
@ -151,7 +151,8 @@ class ChooserModalOnloadHandlerFactory {
|
|||
opts?.chosenLinkSelector || 'a[data-chooser-modal-choice]';
|
||||
this.paginationLinkSelector =
|
||||
opts?.paginationLinkSelector || '.pagination a';
|
||||
this.searchFormSelector = opts?.searchFormSelector || 'form[data-search]';
|
||||
this.searchFormSelector =
|
||||
opts?.searchFormSelector || 'form[data-chooser-modal-search]';
|
||||
this.resultsContainerSelector =
|
||||
opts?.resultsContainerSelector || '#search-results';
|
||||
this.searchInputSelectors = opts?.searchInputSelectors || ['#id_q'];
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
role="tabpanel"
|
||||
aria-labelledby="tab-label-search"
|
||||
>
|
||||
<form class="document-search search-bar" action="{% url 'wagtaildocs:chooser_results' %}" method="GET" novalidate>
|
||||
<form data-chooser-modal-search class="search-bar" action="{% url 'wagtaildocs:chooser_results' %}" method="GET" novalidate>
|
||||
<ul class="fields">
|
||||
{% for field in searchform %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<div class="nice-padding">
|
||||
{% if is_searchable or locale or locale_options %}
|
||||
<form class="snippet-search search-bar" action="{% url 'wagtailsnippets:choose_results' model_opts.app_label model_opts.model_name %}" method="GET" novalidate>
|
||||
<form data-chooser-modal-search class="search-bar" action="{% url 'wagtailsnippets:choose_results' model_opts.app_label model_opts.model_name %}" method="GET" novalidate>
|
||||
{% if locale %}
|
||||
<input type="hidden" name="locale" value="{{ locale.language_code }}">
|
||||
{% endif %}
|
||||
|
|
Ładowanie…
Reference in New Issue