mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix to
onFinish callback flow
This commit is contained in:
parent
4e23aa89e9
commit
4334b2a087
@ -2,6 +2,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [Not released][Not released]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- `to` don't throw error if no `onFinish` callback
|
||||||
|
|
||||||
|
|
||||||
## [0.9.0][2015-02-27]
|
## [0.9.0][2015-02-27]
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -290,7 +290,7 @@
|
|||||||
params.node = this;
|
params.node = this;
|
||||||
params.onFinish = function() {
|
params.onFinish = function() {
|
||||||
tween.destroy();
|
tween.destroy();
|
||||||
onFinish();
|
onFinish && onFinish();
|
||||||
};
|
};
|
||||||
var tween = new Konva.Tween(params);
|
var tween = new Konva.Tween(params);
|
||||||
tween.play();
|
tween.play();
|
||||||
|
@ -170,7 +170,7 @@ suite('Tween', function() {
|
|||||||
tween.play();
|
tween.play();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('transitionTo method', function(done) {
|
test('to method', function(done) {
|
||||||
var stage = addStage();
|
var stage = addStage();
|
||||||
|
|
||||||
var layer = new Konva.Layer();
|
var layer = new Konva.Layer();
|
||||||
@ -197,5 +197,17 @@ suite('Tween', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('to method simple usage', function(done) {
|
||||||
|
var stage = addStage();
|
||||||
|
|
||||||
|
stage.to({
|
||||||
|
x : 10,
|
||||||
|
duration : 0.001
|
||||||
|
});
|
||||||
|
setTimeout(function() {
|
||||||
|
done();
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user