Skip to content

Commit

Permalink
fix layout spinner behaviour on empty maps #688
Browse files Browse the repository at this point in the history
  • Loading branch information
umut-er committed Jul 9, 2024
1 parent 5d25c88 commit eaa41de
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions app/js/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1485,26 +1485,19 @@ module.exports = function() {
// use active chise instance
var chiseInstance = appUtilities.getActiveChiseInstance();


// TODO think whether here is the right place to start the spinner
// if there is no element in the cy instance, then return directly
if(cy.elements().length == 0) {
return;
}
console.log("layout-spinner")
chiseInstance.startSpinner("layout-spinner")

// use the associated cy instance
setTimeout(() => {
var cy = chiseInstance.getCy();


// if there is no element in the cy instance, then return directly
if(cy.elements().length == 0) {
return;
}

// get current general properties for cy
var currentGeneralProperties = appUtilities.getScratch(cy, 'currentGeneralProperties');



var preferences = {
animate: (cy.nodes().length > 3000 || cy.edges().length > 3000) ? false : currentGeneralProperties.animateOnDrawingChanges
};
Expand Down

0 comments on commit eaa41de

Please sign in to comment.