Permalink
Browse files

Fix bug where animations on subviews would cancel a running animation…

… on superviews.
  • Loading branch information...
Koen Bok
Koen Bok committed May 16, 2013
1 parent 6bfb912 commit 0b97774cc16f831e3a762d6be015dbdbd5112253
Showing with 19 additions and 7 deletions.
  1. +14 −5 build/framer.js
  2. +5 −2 src/animation.coffee
View
@@ -1,7 +1,7 @@
// Framer v2.0.0b1-48-g6ce75ff (c) 2013 Koen Bok
// Framer 2.0 (c) 2013 Koen Bok
// https://github.com/koenbok/Framer
window.FramerVersion = "v2.0.0b1-48-g6ce75ff";
window.FramerVersion = "2.0";
(function(){var require = function (file, cwd) {
@@ -722,8 +722,14 @@ require.define("/src/utils.coffee",function(require,module,exports,__dirname,__f
};
};
exports.pointInRect = function(point, rect) {
return alert("Not implemented, you lazy man");
exports.pointInFrame = function(point, frame) {
if (point.x < frame.minX || point.x > frame.maxX) {
return false;
}
if (point.y < frame.minY || point.y > frame.maxY) {
return false;
}
return true;
};
exports.convertPoint = function(point, view1, view2) {
@@ -4015,7 +4021,10 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname
return;
}
this.keyFrameAnimationCSS = this._css();
this.view.once("webkitAnimationEnd", this._finalize);
this.view.once("webkitAnimationEnd", function(event) {
event.stopPropagation();
return _this._finalize();
});
backsideVisibility = "hidden";
if (__indexOf.call(animatedProperties, "rotationX") >= 0 || __indexOf.call(animatedProperties, "rotationY") >= 0) {
backsideVisibility = "visible";
View
@@ -168,7 +168,10 @@ class Animation extends EventEmitter
# Generate the keyframe css and insert
@keyFrameAnimationCSS = @_css()
@view.once "webkitAnimationEnd", @_finalize
@view.once "webkitAnimationEnd", (event) =>
# If we don't do this, all animations on parent views will be stopped
event.stopPropagation()
@_finalize()
# Only enable backside visibility if we are actually going to animate rotation
backsideVisibility = "hidden"
@@ -237,7 +240,7 @@ class Animation extends EventEmitter
_finalize: =>
if @_canceled is true
return

0 comments on commit 0b97774

Please sign in to comment.