fix sometimes not deleted infologs ("0 selected"), because global var got deleted, using now a closure as for the action

This commit is contained in:
Ralf Becker 2020-08-16 11:22:16 +02:00
parent 4f2ad476a6
commit e3434b144d

View File

@ -464,6 +464,7 @@ function nm_open_popup(_action, _selected)
var dialog_parent = dialog.parent(); var dialog_parent = dialog.parent();
var d_buttons = []; var d_buttons = [];
var action = _action; var action = _action;
let selected = _selected;
popup.show(); popup.show();
var close_function = function() var close_function = function()
{ {
@ -483,6 +484,7 @@ function nm_open_popup(_action, _selected)
click: button && button.onclick ? function(e) { click: button && button.onclick ? function(e) {
jQuery(this).dialog("close"); jQuery(this).dialog("close");
nm_popup_action = action; nm_popup_action = action;
nm_popup_ids = selected;
button.onclick.apply(button, e.currentTarget); button.onclick.apply(button, e.currentTarget);
close_function(); close_function();
} : function(e) { } : function(e) {
@ -513,7 +515,7 @@ function nm_open_popup(_action, _selected)
// Reset global variables // Reset global variables
nm_popup_action = null; nm_popup_action = null;
nm_popup_senders = null; nm_popup_ids = null;
} }
} }
@ -567,7 +569,7 @@ function nm_hide_popup(element, div_id)
popup.style.display = 'none'; popup.style.display = 'none';
} }
nm_popup_action = null; nm_popup_action = null;
nm_popup_senders = null; nm_popup_ids = null;
return false; return false;
} }