mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Double-click to remove in Settings lists ❌
This commit is contained in:
@@ -175,9 +175,26 @@
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Function to remove an item from the select element
|
||||
function removeOptionItem(option) {
|
||||
option.remove();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Function to initialize remove functionality on select options
|
||||
function initRemoveBtnOptn(selectorId) {
|
||||
// Attach double-click event listeners to "Remove"
|
||||
$(`#${selectorId} option`).addClass('removable-option').on('dblclick', function() {
|
||||
const $option = $(this);
|
||||
removeOptionItem($option);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user