mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Pass document chooser URL to widget via data attribute instead of chooserUrls
This commit is contained in:
parent
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>
|
||||
|
Loading…
Reference in New Issue
Block a user