mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 09:20:03 +02:00
promise animation basic API working
This commit is contained in:
parent
d208905b77
commit
4b003f057e
2 changed files with 10 additions and 6 deletions
|
@ -9485,12 +9485,14 @@ var PromiseAnimation = Backbone.Model.extend({
|
||||||
// we want to resolve a deferred when the animation finishes
|
// we want to resolve a deferred when the animation finishes
|
||||||
this.get('closure')();
|
this.get('closure')();
|
||||||
setTimeout(_.bind(function() {
|
setTimeout(_.bind(function() {
|
||||||
|
console.log('resolving deferred');
|
||||||
this.get('deferred').resolve();
|
this.get('deferred').resolve();
|
||||||
}, this), this.get('duration'));
|
}, this), this.get('duration'));
|
||||||
|
console.log('the duration', this.get('duration'));
|
||||||
},
|
},
|
||||||
|
|
||||||
then: function() {
|
then: function(func) {
|
||||||
return this.get('deferred').promise.then();
|
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
|
// we want to resolve a deferred when the animation finishes
|
||||||
this.get('closure')();
|
this.get('closure')();
|
||||||
setTimeout(_.bind(function() {
|
setTimeout(_.bind(function() {
|
||||||
|
console.log('resolving deferred');
|
||||||
this.get('deferred').resolve();
|
this.get('deferred').resolve();
|
||||||
}, this), this.get('duration'));
|
}, this), this.get('duration'));
|
||||||
|
console.log('the duration', this.get('duration'));
|
||||||
},
|
},
|
||||||
|
|
||||||
then: function() {
|
then: function(func) {
|
||||||
return this.get('deferred').promise.then();
|
return this.get('deferred').promise.then(func);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -113,8 +113,8 @@ var PromiseAnimation = Backbone.Model.extend({
|
||||||
console.log('the duration', this.get('duration'));
|
console.log('the duration', this.get('duration'));
|
||||||
},
|
},
|
||||||
|
|
||||||
then: function() {
|
then: function(func) {
|
||||||
return this.get('deferred').promise.then();
|
return this.get('deferred').promise.then(func);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue