Lines 134-140
Link Here
|
134 |
} |
134 |
} |
135 |
} |
135 |
} |
136 |
|
136 |
|
137 |
function addNewField() { |
137 |
function addNewField( link ) { |
138 |
var form_field = $('div.form-field-select-text').last(); |
138 |
var form_field = $('div.form-field-select-text').last(); |
139 |
var copy = form_field.clone(true); |
139 |
var copy = form_field.clone(true); |
140 |
copy.find('input,select').not('[type="hidden"]').each(function() { |
140 |
copy.find('input,select').not('[type="hidden"]').each(function() { |
Lines 142-147
Link Here
|
142 |
}); |
142 |
}); |
143 |
copy.find('.form-field-conjunction').prop('disabled', false); |
143 |
copy.find('.form-field-conjunction').prop('disabled', false); |
144 |
form_field.after(copy); |
144 |
form_field.after(copy); |
|
|
145 |
link.remove(); |
145 |
copy.find('select.form-field-column').change(); |
146 |
copy.find('select.form-field-column').change(); |
146 |
} |
147 |
} |
147 |
|
148 |
|
Lines 299-310
Link Here
|
299 |
// Add the "New field" link. |
300 |
// Add the "New field" link. |
300 |
var form_field = $('div.form-field-select-text').last() |
301 |
var form_field = $('div.form-field-select-text').last() |
301 |
var NEW_FIELD = _("New field"); |
302 |
var NEW_FIELD = _("New field"); |
302 |
var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field">' + NEW_FIELD + '</a>'); |
303 |
var button_field_new = $('<a href="#" class="button-field-new" title="Add a new field"><i class="fa fa-plus"></i> ' + NEW_FIELD + '</a>'); |
303 |
button_field_new.click(function() { |
304 |
button_field_new.click(function(e) { |
304 |
addNewField(); |
305 |
e.preventDefault(); |
305 |
return false; |
306 |
addNewField( $(this) ); |
306 |
}); |
307 |
}); |
307 |
form_field.after(button_field_new); |
308 |
form_field.append(button_field_new); |
308 |
|
309 |
|
309 |
// If a field is linked to an authorised values list, display the list. |
310 |
// If a field is linked to an authorised values list, display the list. |
310 |
$('div.form-field-select-text select').change(function() { |
311 |
$('div.form-field-select-text select').change(function() { |
311 |
- |
|
|