mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
ok now it blocks on raphael load
This commit is contained in:
parent
44322298ba
commit
e8ac126f8f
1 changed files with 26 additions and 26 deletions
22
src/main.js
22
src/main.js
|
@ -13,12 +13,9 @@ var animationFactory = null;
|
|||
var paper = null;
|
||||
|
||||
$(document).ready(function(){
|
||||
// static classes
|
||||
animationFactory = new AnimationFactory();
|
||||
|
||||
// the two major collections that affect everything
|
||||
var commitCollection = new CommitCollection();
|
||||
commandCollection = new CommandCollection();
|
||||
var branchCollection = new BranchCollection();
|
||||
|
||||
commandBuffer = new CommandBuffer({
|
||||
collection: commandCollection
|
||||
|
@ -34,6 +31,14 @@ $(document).ready(function(){
|
|||
collection: commandCollection
|
||||
});
|
||||
|
||||
// make the canvas for us
|
||||
Raphael(10, 10, 200, 200, function() {
|
||||
paper = this;
|
||||
|
||||
// the two major collections that affect everything
|
||||
var commitCollection = new CommitCollection();
|
||||
var branchCollection = new BranchCollection();
|
||||
|
||||
gitVisuals = new GitVisuals({
|
||||
commitCollection: commitCollection,
|
||||
branchCollection: branchCollection
|
||||
|
@ -46,9 +51,6 @@ $(document).ready(function(){
|
|||
|
||||
$('#commandTextField').focus();
|
||||
|
||||
// make the canvas for us
|
||||
Raphael(10, 10, 200, 200, function() {
|
||||
paper = this;
|
||||
// needs to be called before raphael ready
|
||||
windowResize();
|
||||
events.trigger('raphaelReady');
|
||||
|
@ -58,7 +60,6 @@ $(document).ready(function(){
|
|||
windowResize();
|
||||
setTimeout(windowResize, 50);
|
||||
|
||||
|
||||
if (/\?demo/.test(window.location.href)) {
|
||||
setTimeout(function() {
|
||||
events.trigger('submitCommandValueFromEvent', "gc; git checkout HEAD~1; git commit; git checkout -b bugFix; gc; gc; git rebase master; git checkout master; gc; gc; git merge bugFix");
|
||||
|
@ -68,8 +69,6 @@ $(document).ready(function(){
|
|||
|
||||
function windowResize() {
|
||||
var smaller = 10;
|
||||
|
||||
if (paper && paper.canvas) {
|
||||
var el = $('#canvasWrapper')[0];
|
||||
|
||||
var left = el.offsetLeft;
|
||||
|
@ -77,12 +76,13 @@ function windowResize() {
|
|||
var width = el.clientWidth - smaller;
|
||||
var height = el.clientHeight - smaller;
|
||||
|
||||
if (paper && paper.canvas) {
|
||||
$(paper.canvas).css({
|
||||
left: left + 'px',
|
||||
top: top + 'px'
|
||||
});
|
||||
paper.setSize(width, height);
|
||||
}
|
||||
events.trigger('canvasResize', width, height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue