feat: update mindmap.js for improved performance and functionality

This commit is contained in:
2025-05-17 10:25:40 +01:00
parent 5b9ae85453
commit 9dc44f94f6

View File

@@ -182,6 +182,23 @@ async function loadMindmapData(nodeId = null) {
}
}
/**
* Zerstört eine Cytoscape-Instanz sicher
* @param {Object} instance - Die zu zerstörende Cytoscape-Instanz
*/
function destroyCytoscapeInstance(instance) {
if (instance && typeof instance.destroy === 'function') {
try {
// Event-Listener entfernen
instance.removeAllListeners();
// Instanz zerstören
instance.destroy();
} catch (e) {
console.error('Fehler beim Zerstören der Cytoscape-Instanz:', e);
}
}
}
// Funktion zum Initialisieren der Mindmap
async function initializeMindmap() {
try {