mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 16:29:45 -05:00
Merge pull request #1975 from Squidly271/patch-15
Dashboard - Prevent event handlers continually being created
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user