Fixed a problem with mismatched attribute names for ajax form field autocompletes. Closes issue #1049.
- Legacy-Id: 5771
This commit is contained in:
parent
5bee7ac538
commit
b7246168bf
|
@ -42,5 +42,5 @@ Change the document shepherd for {{ doc.name }}-{{ doc.rev }}
|
|||
{% endblock %}
|
||||
{% block content_end %}
|
||||
<script type="text/javascript" src="/js/lib/jquery.tokeninput.js"></script>
|
||||
<script type="text/javascript" src="/js/emails-field.js"></script>
|
||||
<script type="text/javascript" src="/js/tokenized-field.js"></script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</tr>
|
||||
<tr class="docs">
|
||||
<td>Drafts:</td>
|
||||
<td><input name="{{ form.docs.html_name }}" class="tokenized-field" data-ajaxurl="{% url wg_ajax_search_docs group.acronym %}" data-pre="{{ form.docs_prepopulate }}"/>
|
||||
<td><input name="{{ form.docs.html_name }}" class="tokenized-field" data-ajax-url="{% url wg_ajax_search_docs group.acronym %}" data-pre="{{ form.docs_prepopulate }}"/>
|
||||
{{ form.docs.errors }}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
jQuery(function () {
|
||||
jQuery(".emails-field").each(function () {
|
||||
jQuery(".tokenized-field").each(function () {
|
||||
var e = jQuery(this);
|
||||
var pre = [];
|
||||
if (e.val())
|
||||
pre = JSON.parse(e.val());
|
||||
e.tokenInput(e.data("ajax-url"), {
|
||||
e.tokenInput(e.data("data-ajax-url"), {
|
||||
hintText: "",
|
||||
preventDuplicates: true,
|
||||
prePopulate: pre
|
||||
|
|
|
@ -8,7 +8,7 @@ function setupTokenizedField(field) {
|
|||
else if (field.data("pre"))
|
||||
pre = JSON.parse((field.attr("data-pre") || "").replace(/"/g, '"'));
|
||||
|
||||
field.tokenInput(field.data("ajaxurl"), {
|
||||
field.tokenInput(field.attr("data-ajax-url"), {
|
||||
hintText: "",
|
||||
preventDuplicates: true,
|
||||
prePopulate: pre
|
||||
|
|
Loading…
Reference in a new issue