Skip to content

Commit

Permalink
fixes for #688
Browse files Browse the repository at this point in the history
  • Loading branch information
umut-er committed Jul 9, 2024
1 parent eaa41de commit b09f105
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
18 changes: 5 additions & 13 deletions app/js/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1486,16 +1486,14 @@ module.exports = function() {
var chiseInstance = appUtilities.getActiveChiseInstance();

// if there is no element in the cy instance, then return directly
var cy = chiseInstance.getCy();
if(cy.elements().length == 0) {
return;
}
console.log("layout-spinner")
chiseInstance.startSpinner("layout-spinner")

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

// get current general properties for cy
var currentGeneralProperties = appUtilities.getScratch(cy, 'currentGeneralProperties');
var preferences = {
Expand All @@ -1510,22 +1508,16 @@ module.exports = function() {
// use active chise instance
var chiseInstance = appUtilities.getActiveChiseInstance();

// TODO think whether here is the right place to start the 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
var cy = chiseInstance.getCy();
if(cy.elements().length == 0) {
return;
}
chiseInstance.startSpinner("layout-spinner");

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



var preferences = {
quality: (cy.nodes().length > 3000 || cy.edges().length > 3000) ? "draft" : "default",
animate: (cy.nodes().length > 3000 || cy.edges().length > 3000) ? false : currentGeneralProperties.animateOnDrawingChanges,
Expand Down
7 changes: 6 additions & 1 deletion app/js/backbone-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -4354,8 +4354,13 @@ var PromptConfirmationView = Backbone.View.extend({
$(document)
.off("click", "#prompt-confirmation-accept")
.on("click", "#prompt-confirmation-accept", function (evt) {
afterFunction();
$(self.el).modal("toggle");

// This timeout is to insure that the modal disappers properly.
// Without this sometimes there would be weird behavior on file loading.
setTimeout(() => {
afterFunction();
}, 500);
});

$(document)
Expand Down

0 comments on commit b09f105

Please sign in to comment.