mirror of
https://github.com/itflow-org/itflow
synced 2026-09-21 22:21:15 +00:00
Migrate fully away from Jquery Stage 1
This commit is contained in:
@@ -21,14 +21,14 @@
|
||||
// If the client selector is disabled, we must be on a client-specific page instead. Trigger the lists to update.
|
||||
if (clientSelectDropdown.disabled) {
|
||||
|
||||
let client_id = $(clientSelectDropdown).find(':selected').val();
|
||||
let client_id = clientSelectDropdown.value;
|
||||
|
||||
populateLists(client_id);
|
||||
}
|
||||
|
||||
// Listener for client selection. Populate select lists when a client is selected
|
||||
$(clientSelectDropdown).on('change', function (e) {
|
||||
let client_id = $(this).find(':selected').val();
|
||||
clientSelectDropdown.addEventListener('change', function () {
|
||||
let client_id = this.value;
|
||||
|
||||
// Update the dependent dropdown lists
|
||||
populateLists(client_id);
|
||||
@@ -77,7 +77,7 @@
|
||||
dropdown.innerHTML = '';
|
||||
|
||||
// A multi-select keeps showing its old selections until select2 is told the value changed
|
||||
clearTomSelect(dropdown instanceof Element ? dropdown : $(dropdown)[0]);
|
||||
clearTomSelect(dropdown);
|
||||
|
||||
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) {
|
||||
refreshTomSelect(dropdown instanceof Element ? dropdown : $(dropdown)[0]);
|
||||
refreshTomSelect(dropdown);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user