mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminando servicios manipulados y preimpresion
This commit is contained in:
@ -1,51 +0,0 @@
|
||||
/**
|
||||
* Selects & Tags
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
$(function () {
|
||||
const selectPicker = $('.selectpicker'),
|
||||
select2 = $('.select2'),
|
||||
select2Icons = $('.select2-icons');
|
||||
|
||||
// Bootstrap Select
|
||||
// --------------------------------------------------------------------
|
||||
if (selectPicker.length) {
|
||||
selectPicker.selectpicker();
|
||||
}
|
||||
|
||||
// Select2
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// Default
|
||||
if (select2.length) {
|
||||
select2.each(function () {
|
||||
var $this = $(this);
|
||||
$this.wrap('<div class="position-relative"></div>').select2({
|
||||
placeholder: 'Select value',
|
||||
dropdownParent: $this.parent()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Select2 Icons
|
||||
if (select2Icons.length) {
|
||||
// custom template to render icons
|
||||
function renderIcons(option) {
|
||||
if (!option.id) {
|
||||
return option.text;
|
||||
}
|
||||
var $icon = "<i class='" + $(option.element).data('icon') + " me-2'></i>" + option.text;
|
||||
|
||||
return $icon;
|
||||
}
|
||||
select2Icons.wrap('<div class="position-relative"></div>').select2({
|
||||
templateResult: renderIcons,
|
||||
templateSelection: renderIcons,
|
||||
escapeMarkup: function (es) {
|
||||
return es;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user