kopia lustrzana https://github.com/wagtail/wagtail
Pass document chooser URL to widget via data attribute instead of chooserUrls
rodzic
90e2899b71
commit
523148521b
|
@ -6,7 +6,7 @@ function createDocumentChooser(id) {
|
|||
|
||||
$('.action-choose', chooserElement).on('click', function() {
|
||||
ModalWorkflow({
|
||||
url: window.chooserUrls.documentChooser,
|
||||
url: chooserElement.data('chooserUrl'),
|
||||
onload: DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS,
|
||||
responses: {
|
||||
documentChosen: function(docData) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends "wagtailadmin/widgets/chooser.html" %}
|
||||
{% block chooser_class %}document-chooser{% endblock %}
|
||||
{% block chooser_attributes %}data-chooser-url="{% url "wagtaildocs:chooser" %}"{% endblock %}
|
||||
|
||||
{% block chosen_state_view %}
|
||||
<span class="title">{{ document.title }}</span>
|
||||
|
|
Ładowanie…
Reference in New Issue