mirror of
https://github.com/itflow-org/itflow
synced 2026-09-05 06:15:11 +00:00
Update Font, Migrated away from JQUERY dependent libs: toastr to bootstrap5 toasts, daterangepicker to flatpickr, select2 to Tom Select, InputMask to IMask
This commit is contained in:
@@ -13,12 +13,10 @@ function populateShareModal(client_id, item_type, item_ref_id) {
|
||||
document.getElementById("div_share_link_form").hidden = false;
|
||||
document.getElementById("div_share_link_generate").hidden = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#share_email').select2({
|
||||
tags: true,
|
||||
placeholder: 'Select or type a value',
|
||||
allowClear: true
|
||||
});
|
||||
initTomSelect(document.getElementById('share_email'), {
|
||||
create: true,
|
||||
placeholder: 'Select or type a value',
|
||||
allowEmptyOption: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
// Refresh Select2
|
||||
if ($.fn.select2) {
|
||||
$contactSelect.trigger('change.select2');
|
||||
}
|
||||
refreshTomSelect($contactSelect[0]);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX Error:', error);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
// Listener for client selection. Populate select lists when a client is selected
|
||||
$(clientSelectDropdown).on('select2:select', function (e) {
|
||||
$(clientSelectDropdown).on('change', function (e) {
|
||||
let client_id = $(this).find(':selected').val();
|
||||
|
||||
// Update the dependent dropdown lists
|
||||
@@ -77,7 +77,7 @@
|
||||
dropdown.innerHTML = '';
|
||||
|
||||
// A multi-select keeps showing its old selections until select2 is told the value changed
|
||||
$(dropdown).val(null).trigger('change.select2');
|
||||
clearTomSelect(dropdown instanceof Element ? dropdown : $(dropdown)[0]);
|
||||
|
||||
if (placeholderLabel !== null) {
|
||||
dropdown[dropdown.length] = new Option(placeholderLabel, placeholderValue);
|
||||
@@ -89,7 +89,7 @@
|
||||
// Redraws a select2 component after its options have been replaced
|
||||
function refreshDropdown(dropdown) {
|
||||
if (dropdown) {
|
||||
$(dropdown).trigger('change.select2');
|
||||
refreshTomSelect(dropdown instanceof Element ? dropdown : $(dropdown)[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user