mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
NMAPDEV plugin work v0.5 #645 🆕🔎
This commit is contained in:
@@ -185,11 +185,42 @@
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Function to initialize remove functionality on select options
|
||||
function initRemoveBtnOptn(selectorId) {
|
||||
|
||||
let isDoubleClick = false;
|
||||
|
||||
function initListInteractionOptions(selectorId) {
|
||||
|
||||
$(`#${selectorId} option`).addClass('interactable-option')
|
||||
|
||||
// Attach double-click event listeners to "Remove"
|
||||
$(`#${selectorId} option`).addClass('removable-option').on('dblclick', function() {
|
||||
const $option = $(this);
|
||||
removeOptionItem($option);
|
||||
$(`#${selectorId} option`).on('dblclick', function() {
|
||||
isDoubleClick = true;
|
||||
const $option = $(this);
|
||||
removeOptionItem($option);
|
||||
});
|
||||
|
||||
$(`#${selectorId} option`).on('click', function() {
|
||||
const $option = $(this);
|
||||
|
||||
// Reset the flag after a short delay
|
||||
setTimeout(() => {
|
||||
console.log(isDoubleClick);
|
||||
if (!isDoubleClick) {
|
||||
// Single-click action
|
||||
showModalFieldInput (
|
||||
`<i class="fa fa-square-plus pointer"></i> ${getString('DevDetail_button_AddIcon')}`,
|
||||
getString('DevDetail_button_AddIcon_Help'),
|
||||
getString('Gen_Cancel'),
|
||||
getString('Gen_Okay'),
|
||||
$option.html(),
|
||||
function() {
|
||||
alert('aaa');
|
||||
});
|
||||
|
||||
isDoubleClick = false;
|
||||
}
|
||||
|
||||
}, 300); // Adjust this delay as needed
|
||||
});
|
||||
}
|
||||
|
||||
@@ -198,3 +229,9 @@ function initRemoveBtnOptn(selectorId) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user