mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 05:23:49 +00:00
fix error when adding customfield choice
This commit is contained in:
@@ -52,9 +52,9 @@
|
||||
{# we use javascrit to add an additional element. All functions are personnalized with the id ( = form.vars.id) #}
|
||||
<script type="text/javascript">
|
||||
function addElementInDiv(div_id) {
|
||||
var div = $('#' + div_id);
|
||||
var prototype = div.data('prototype');
|
||||
var index = div.data('index');
|
||||
var div = $('#' + div_id);console.log(div);
|
||||
var prototype = div.data('prototype');console.log(prototype);
|
||||
var index = div.data('index');console.log(index);
|
||||
var add_element_link = $('#' + div_id + '_add_element_link');
|
||||
var new_fields = prototype.replace(/__name__label__/g, index);
|
||||
var new_fields = prototype.replace(/__name__/g, index);
|
||||
@@ -68,7 +68,8 @@
|
||||
var add_element_link = $('<a id="' + div_id + '_add_element_link"" href="#" class="sc-button bt-submit">{{ 'Add an element'|trans }}</a>');
|
||||
var div = $('#' + div_id);
|
||||
div.append(add_element_link);
|
||||
div.data('index', div.find(':input').length / 5);
|
||||
div.data('index', div.find('td').length);
|
||||
console.log(div.data('index'));
|
||||
|
||||
add_element_link.on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
Reference in New Issue
Block a user