feat: update mindmap.js for improved performance and functionality
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user