Bug 25728: fix rebase issues
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
3e2966839e
commit
c6ad2eba4d
|
|
@ -161,13 +161,9 @@
|
|||
<input type="hidden" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]">
|
||||
[% ELSIF ( mv.type == 'select' ) %]
|
||||
[% IF ( mv.readonly || ite.IS_RETURN_CLAIM ) %]
|
||||
<select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor select2" readonly="readonly" disabled="disabled">
|
||||
<select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
|
||||
[% ELSE %]
|
||||
[% IF mv.category AND CAN_user_parameters_manage_auth_values %]
|
||||
<select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" data-category="[% mv.category | html %]">
|
||||
[% ELSE %]
|
||||
<select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor select2">
|
||||
[% END %]
|
||||
<select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" data-category="[% mv.category | html %]">
|
||||
[% END %]
|
||||
[% FOREACH aval IN mv.values %]
|
||||
[% IF aval == mv.default %]
|
||||
|
|
|
|||
|
|
@ -90,42 +90,58 @@ var Select2Utils = {
|
|||
initSelect2: function(selects) {
|
||||
if ($.fn.select2) {
|
||||
if ( window.CAN_user_parameters_manage_auth_values === undefined || ! CAN_user_parameters_manage_auth_values ) {
|
||||
$(selects).select2();
|
||||
} else {
|
||||
$(selects).select2({
|
||||
tags: true,
|
||||
createTag: function (tag) {
|
||||
return {
|
||||
id: tag.term,
|
||||
text: tag.term,
|
||||
newTag: true
|
||||
};
|
||||
},
|
||||
templateResult: function(state) {
|
||||
if (state.newTag) {
|
||||
return state.text + " " + __("(select to create)");
|
||||
}
|
||||
return state.text;
|
||||
}
|
||||
}).on("select2:select", function(e) {
|
||||
if(e.params.data.newTag){
|
||||
current_select2 = this;
|
||||
var category = $(this).data("category");
|
||||
$("#avCreate #new_av_category").html(category);
|
||||
$("#avCreate input[name='category']").val(category);
|
||||
$("#avCreate input[name='value']").val(e.params.data.text);
|
||||
$("#avCreate input[name='description']").val(e.params.data.text);
|
||||
|
||||
$(this).val($(this).find("option:first").val()).trigger('change');
|
||||
$('#avCreate').modal({show:true});
|
||||
}
|
||||
}).on("select2:clear", function () {
|
||||
$(selects).select2().on("select2:clear", function () {
|
||||
$(this).on("select2:opening.cancelOpen", function (evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
$(this).off("select2:opening.cancelOpen");
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$(selects).each(function(){
|
||||
if ( !$(this).data("category") ) {
|
||||
$(this).select2().on("select2:clear", function () {
|
||||
$(this).on("select2:opening.cancelOpen", function (evt) {
|
||||
evt.preventDefault();
|
||||
$(this).off("select2:opening.cancelOpen");
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$(this).select2({
|
||||
tags: true,
|
||||
createTag: function (tag) {
|
||||
return {
|
||||
id: tag.term,
|
||||
text: tag.term,
|
||||
newTag: true
|
||||
};
|
||||
},
|
||||
templateResult: function(state) {
|
||||
if (state.newTag) {
|
||||
return state.text + " " + __("(select to create)");
|
||||
}
|
||||
return state.text;
|
||||
}
|
||||
}).on("select2:select", function(e) {
|
||||
if(e.params.data.newTag){
|
||||
current_select2 = this;
|
||||
var category = $(this).data("category");
|
||||
$("#avCreate #new_av_category").html(category);
|
||||
$("#avCreate input[name='category']").val(category);
|
||||
$("#avCreate input[name='value']").val(e.params.data.text);
|
||||
$("#avCreate input[name='description']").val(e.params.data.text);
|
||||
|
||||
$(this).val($(this).find("option:first").val()).trigger('change');
|
||||
$('#avCreate').modal({show:true});
|
||||
}
|
||||
}).on("select2:clear", function () {
|
||||
$(this).on("select2:opening.cancelOpen", function (evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
$(this).off("select2:opening.cancelOpen");
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue