Clean dialog box on creation

Former-commit-id: 824f7a968b2e196d6df98b9f5dbd48f21a7c9859
This commit is contained in:
fermin831 2019-02-05 15:31:08 +01:00
parent 68bdbd511c
commit b4f3e94b13
1 changed files with 4 additions and 0 deletions

View File

@ -117,6 +117,10 @@ function notifications_disable_source(event) {
function add_source_dialog(users, source_id) {
// Display the dialog
var dialog_id = 'global_config_notifications_dialog_add-' + users + '-' + source_id;
// Clean id element.
var previous_dialog = document.getElementById(dialog_id);
if (previous_dialog !== null) previous_dialog.remove();
// Create or recreate the content.
var not_dialog = document.createElement('div');
not_dialog.setAttribute('class', 'global_config_notifications_dialog_add');
not_dialog.setAttribute('id', dialog_id);