From 4b003f057ef8e6a08f23ce19296243e55037284c Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sun, 2 Jun 2013 16:29:01 -0700 Subject: [PATCH] promise animation basic API working --- build/bundle.js | 12 ++++++++---- src/js/visuals/animation/index.js | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build/bundle.js b/build/bundle.js index 11fef386..da0800f7 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -9485,12 +9485,14 @@ var PromiseAnimation = Backbone.Model.extend({ // we want to resolve a deferred when the animation finishes this.get('closure')(); setTimeout(_.bind(function() { + console.log('resolving deferred'); this.get('deferred').resolve(); }, this), this.get('duration')); + console.log('the duration', this.get('duration')); }, - then: function() { - return this.get('deferred').promise.then(); + then: function(func) { + return this.get('deferred').promise.then(func); } }); @@ -31536,12 +31538,14 @@ var PromiseAnimation = Backbone.Model.extend({ // we want to resolve a deferred when the animation finishes this.get('closure')(); setTimeout(_.bind(function() { + console.log('resolving deferred'); this.get('deferred').resolve(); }, this), this.get('duration')); + console.log('the duration', this.get('duration')); }, - then: function() { - return this.get('deferred').promise.then(); + then: function(func) { + return this.get('deferred').promise.then(func); } }); diff --git a/src/js/visuals/animation/index.js b/src/js/visuals/animation/index.js index 4ebbcc4f..972b2844 100644 --- a/src/js/visuals/animation/index.js +++ b/src/js/visuals/animation/index.js @@ -113,8 +113,8 @@ var PromiseAnimation = Backbone.Model.extend({ console.log('the duration', this.get('duration')); }, - then: function() { - return this.get('deferred').promise.then(); + then: function(func) { + return this.get('deferred').promise.then(func); } });