Skip to content

Commit

Permalink
Apply setTimeout when animate:end #45
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanbalci committed Aug 8, 2017
1 parent 219e6c0 commit 2f1a298
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cytoscape-cose-bilkent.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,15 @@ _CoSELayout.prototype.run = function () {
/*
* If animate option is not 'during' ('end' or false) perform these here (If it is 'during' similar things are already performed)
*/
if(this.options.animate !== 'during'){
if(this.options.animate == 'end'){
setTimeout(function() {
self.options.eles.nodes().not(":parent").layoutPositions(self, self.options, getPositions); // Use layout positions to reposition the nodes it considers the options parameter
ready = false;
}, 0);
}
else if(this.options.animate == 'false'){
self.options.eles.nodes().not(":parent").layoutPositions(self, self.options, getPositions); // Use layout positions to reposition the nodes it considers the options parameter
ready = false;
}

return this; // chaining
Expand Down

0 comments on commit 2f1a298

Please sign in to comment.