Merge pull request #1975 from Squidly271/patch-15

Dashboard - Prevent event handlers continually being created
This commit is contained in:
tom mortensen
2025-01-07 13:37:29 -08:00
committed by GitHub
3 changed files with 4 additions and 1 deletions
@@ -49,6 +49,7 @@ function addDockerContainerContext(container, image, template, started, paused,
opts.push({divider:true});
opts.push({text:_('Donate'),icon:'fa-external-link', href:donateLink,target:'_blank'});
}
context.destroy('#'+id);
context.attach('#'+id, opts);
}
function addDockerImageContext(image, imageTag) {
@@ -239,7 +239,7 @@ function addVMContext(name, uuid, template, state, vmrcurl, vmrcprotocol, log, f
}});
}
}
if (usage) context.attach('#vmusage-'+uuid, opts); else context.attach('#vm-'+uuid, opts);
if (usage) { context.destroy('#vmusage-'+uuid); context.attach('#vmusage-'+uuid, opts); } else { context.destroy('#vm-'+uuid); context.attach('#vm-'+uuid, opts); }
}
function addVMSnapContext(name, uuid, template, state, snapshotname, method){
var opts = [];
@@ -273,6 +273,7 @@ function addVMSnapContext(name, uuid, template, state, snapshotname, method){
$('#vm-'+uuid).find('i').removeClass('fa-play fa-square fa-pause').addClass('fa-refresh fa-spin');
selectsnapshot(uuid, name, snapshotname, "remove",true) ;
}});
context.destroy('#vmsnap-'+uuid);
context.attach('#vmsnap-'+uuid, opts);
}
function startAll() {
+1
View File
@@ -1033,6 +1033,7 @@ function smartMenu(table) {
opts.push({text:"_(Acknowledge)_",icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(id,disk);}});
}
$(id).bind('click',function(){update2=false;}).bind('mouseout',function(){setTimeout(function(){update2=true;},15000);});
context.destroy(id);
context.attach(id,opts);
});
}