[seed] extensions: Clutter animation wrappers should save animate wrappers



commit 0f74c3fbb0c872c5dec6d8c6d381bb49277ad8fc
Author: Robert Carr <racarr svn gnome org>
Date:   Mon May 25 06:53:57 2009 -0400

    extensions: Clutter animation wrappers should save animate wrappers
---
 extensions/Clutter.js |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/extensions/Clutter.js b/extensions/Clutter.js
index 20efdb3..169a811 100644
--- a/extensions/Clutter.js
+++ b/extensions/Clutter.js
@@ -8,9 +8,16 @@ Clutter.Actor.prototype.animate = function(mode, duration, json)
 	properties.push(prop);
 	endvalues.push(new Array(this.__property_type(prop), json[prop]));
     }
-    return this.animatev(mode, duration, properties.length, 
-			 properties, endvalues);
-
+    
+    var animation =  this.animatev(mode, duration, properties.length, 
+				   properties, endvalues);
+    this.__animation__ = animation;
+    animation.timeline.signal["completed"].connect(
+	function(timeline, obj){
+	    delete obj.__animation__;
+	}, this);
+    
+    return animation;
 }
 
 Clutter.Actor.prototype.animate_with_timeline = function(mode, timeline, json)
@@ -21,7 +28,16 @@ Clutter.Actor.prototype.animate_with_timeline = function(mode, timeline, json)
 	properties.push(prop);
 	endvalues.push(new Array(this.__property_type(prop), json[prop]));
     }
-    return this.animate_with_timelinev(mode, timeline, properties.length, 
-				       properties, endvalues);
 
+    var animation = 
+	this.animate_with_timelinev(mode, timeline, properties.length, 
+				    properties, endvalues);
+    
+    this.__animation__ = animation;
+    animation.timeline.signal["completed"].connect(
+	function(timeline, obj){
+	    delete obj.__animation__;
+	}, this);
+    
+    return animation;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]