Commit 11aecd3e authored by Serge S. Koval's avatar Serge S. Koval

Fixed inline field template name collision

parent ea8d7c9a
......@@ -22,7 +22,7 @@
this.addInlineField = function(id, el, template) {
var $el = $(el);
var $template = $($(template).html());
var $template = $($(template).text());
// Figure out new field ID
var lastField = $el.children('.fa-inline-field').last();
......
......@@ -15,12 +15,14 @@
{% endfor %}
</div>
<div id="{{ field.id }}-template" class="hide">
{% filter forceescape %}
<div class="fa-inline-field">
<div class="fa-inline-field-control">
<a href="javascript:void(0)" class="fa-remove-field"><i class="icon-remove"></i></a>
</div>
{{ render(template) }}
</div>
{% endfilter %}
</div>
<a id="{{ field.id }}-button" href="javascript:void(0)" class="btn" onclick="faForm.addInlineField('{{ field.id }}', '#{{ field.id }}-fields', '#{{ field.id }}-template');">{{ _gettext('Add') }} {{ field.label.text }}</a>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment