Skip to content

Instantly share code, notes, and snippets.

@ColinCampbell
Created March 15, 2011 18:55
Show Gist options
  • Select an option

  • Save ColinCampbell/871228 to your computer and use it in GitHub Desktop.

Select an option

Save ColinCampbell/871228 to your computer and use it in GitHub Desktop.
diff --git a/frameworks/core_foundation/views/view/animation.js b/frameworks/core_foundation/views/view/animation.js
index 39f9c56..a14115c 100644
--- a/frameworks/core_foundation/views/view/animation.js
+++ b/frameworks/core_foundation/views/view/animation.js
@@ -86,21 +86,24 @@ SC.View.reopen(
value = hash[key];
cur = layout[key];
- if (cur !== value) { didChange = YES; }
+ if (cur !== value) {
+ didChange = YES;
+
+ if (SC.ANIMATABLE_PROPERTIES[key]) {
+ curAnim = layout.animate[key];
- if (SC.ANIMATABLE_PROPERTIES[key]) {
- curAnim = layout.animate[key];
+ // loose comparison used instead of (value === null || value === undefined)
+ if (value == null) { throw "Can only animate to an actual value!"; }
- // loose comparison used instead of (value === null || value === undefined)
- if (value == null) { throw "Can only animate to an actual value!"; }
+ // FIXME: We should check more than duration
+ if (curAnim && curAnim.duration !== options.duration) { didChange = YES; }
- // FIXME: We should check more than duration
- if (curAnim && curAnim.duration !== options.duration) { didChange = YES; }
+ layout.animate[key] = options;
+ }
- layout.animate[key] = options;
- }
+ layout[key] = value;
- layout[key] = value;
+ }
}
diff --git a/frameworks/core_foundation/views/view/layout_style.js b/frameworks/core_foundation/views/view/layout_style.js
index 8c2e8cc..d5703c0 100644
--- a/frameworks/core_foundation/views/view/layout_style.js
+++ b/frameworks/core_foundation/views/view/layout_style.js
@@ -519,6 +519,7 @@ SC.View.LayoutStyleCalculator = SC.Object.extend({
var propertyName = evt.originalEvent.propertyName,
animation, idx;
+ SC.Logger.log(this.get('view').toString(), propertyName);
animation = this._activeAnimations ? this._activeAnimations[propertyName] : null;
if(animation) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment