mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 07:58:34 +02:00
fixed really subtle process.nextTick bug
This commit is contained in:
parent
e74266f00e
commit
d5bddcc6b4
4 changed files with 24 additions and 15 deletions
|
@ -20,11 +20,12 @@ var Visualization = Backbone.View.extend({
|
|||
// we want to add our canvas somewhere
|
||||
var container = options.containerElement || $('#canvasHolder')[0];
|
||||
new Raphael(container, 200, 200, function() {
|
||||
|
||||
// for some reason raphael calls this function with a predefined
|
||||
// context...
|
||||
// so switch it
|
||||
_this.paperInitialize(this, options);
|
||||
// raphael calls with paper as this for some inane reason...
|
||||
var paper = this;
|
||||
// use process.nextTick to go from sync to async
|
||||
process.nextTick(function() {
|
||||
_this.paperInitialize(paper, options);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue