fix for performance optimizations
This commit is contained in:
parent
52ea7acf04
commit
5d1d249910
@ -74,6 +74,7 @@ class GraphManager {
|
||||
|
||||
// Manual refresh button for polling optimization
|
||||
this.manualRefreshButton = null;
|
||||
this.manualRefreshHandler = null; // Store the handler
|
||||
|
||||
this.options = {
|
||||
nodes: {
|
||||
@ -284,6 +285,10 @@ class GraphManager {
|
||||
|
||||
// Manual refresh button - handler will be set by main app
|
||||
this.manualRefreshButton = document.getElementById('graph-manual-refresh');
|
||||
// If a handler was set before the button existed, attach it now
|
||||
if (this.manualRefreshButton && this.manualRefreshHandler) {
|
||||
this.manualRefreshButton.addEventListener('click', this.manualRefreshHandler);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -291,6 +296,8 @@ class GraphManager {
|
||||
* @param {Function} handler - Function to call when manual refresh is clicked
|
||||
*/
|
||||
setManualRefreshHandler(handler) {
|
||||
this.manualRefreshHandler = handler;
|
||||
// If the button already exists, attach the handler
|
||||
if (this.manualRefreshButton && typeof handler === 'function') {
|
||||
this.manualRefreshButton.addEventListener('click', handler);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user