fix selection of extra criterias (#3776)
This commit is contained in:
parent
a49caf2476
commit
391d8146d2
|
@ -205,14 +205,15 @@ function select_metatype(elem)
|
|||
$.querywidget.updateSearch();
|
||||
});
|
||||
|
||||
$('option[data-index]').click(function() {
|
||||
index = $(this).data('index');
|
||||
$('option[data-index]').parents('select').change(function() {
|
||||
index = $(this).find('option[data-index]:selected').data('index');
|
||||
if ($('option[value="' + index + '"]:selected').length == 0) {
|
||||
$('.addIndex option[value="' + index + '"]').prop('selected', true);
|
||||
$('.addIndex').trigger('change');
|
||||
var criteria_div = $('option[value="' + index + '"]:selected').parents('select').parent().detach();
|
||||
criteria_div.appendTo('.more-fieldset .criteria-content');
|
||||
criteria_div.find('select.queryindex').prop('disabled', true);
|
||||
$($(this).find('option[data-index]').parents('select').find('option')[0]).prop('selected', true);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
<legend>Critères supplémentaires</legend>
|
||||
<div class="criteria-content QueryWidget" data-fieldname="form.widgets.query" style="display:none;">
|
||||
<select>
|
||||
<option>Sélectionnez un critère</option>
|
||||
<optgroup label="Dates">
|
||||
<option data-index="created">Date de création</option>
|
||||
<option data-index="deadline">Date limite de traitement</option>
|
||||
|
|
Reference in New Issue