diff --git a/src/async.js b/src/async.js index f4e36cfa..963abe99 100644 --- a/src/async.js +++ b/src/async.js @@ -43,10 +43,15 @@ var AnimationQueue = Backbone.Model.extend({ start: function() { this.set('index', 0); + + // set the global lock that we are animating + GLOBAL.isAnimating = true; this.next(); }, finish: function() { + // release lock here + GLOBAL.isAnimating = false; this.get('callback')(); }, diff --git a/src/constants.js b/src/constants.js index 6c5cdd3c..510d103d 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,16 +1,13 @@ - /** * Constants....!!! */ -var constants = { - clickDragMass: 20, - baseMass: 1, -}; - var TIME = { betweenCommandsDelay: 400, - commandShow: 300, - reflowGuess: 100 +}; + +// useful for locks, etc +var GLOBAL = { + isAnimating: false }; var GRAPHICS = { @@ -43,39 +40,3 @@ var GRAPHICS = { orphanNodeFill: 'hsb(0.5,0.8,0.7)', }; -/** - * Graphics style -- DEPRECATED - */ -var graphics = { - // colors - edgeStroke: 'rgba(94%, 96%, 98%, 0.5)', // '#EFF5FB', - nodeEdge: 'rgba(94%, 96%, 98%, 0.9)', // '#EFF5FB', - nodeFill: '#0066cc', - nodeRadius: 10, - - // widths - nodeStrokeWidth: 15, - edgeWidth: 2, - - // ref names - refFont: '14pt Courier New', - refFontFill: '#FFF', - refSelectedFontFill: 'rgb(255, 30, 10)', - - // ref arrows - arrowFill: '#FFF', - arrowStroke: '#000', - arrowWidth: 4, - arrowHeadWidth: 5, -}; - -function randomString(string_length) { - var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; - var randomstring = ''; - for (var i=0; i