From 0069212e607c6fe6464b53daaf3e95865388553e Mon Sep 17 00:00:00 2001 From: oallouch Date: Mon, 12 Nov 2012 11:42:28 +0100 Subject: [PATCH] Update Source/Fx.CSS3.js 'tweenCSS3' and 'morphCSS3' properties added --- Source/Fx.CSS3.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Source/Fx.CSS3.js b/Source/Fx.CSS3.js index be1b211..09b0bda 100644 --- a/Source/Fx.CSS3.js +++ b/Source/Fx.CSS3.js @@ -433,4 +433,50 @@ provides: [Fx.Tween.CSS3, Fx.Morph.CSS3, Fx.Elements.CSS3] } +})(); + +/** + * 'tweenCSS3' and 'morphCSS3' properties + */ +(function() { + Element.Properties.tweenCSS3 = { + set: function(options){ + this.get('tweenCSS3').cancel().setOptions(options); + return this; + }, + get: function(){ + var tween = this.retrieve('tweenCSS3'); + if (!tween){ + tween = new Fx.Tween.CSS3(this, {link: 'cancel'}); + this.store('tweenCSS3', tween); + } + return tween; + } + }; + + Element.Properties.morphCSS3 = { + set: function(options){ + this.get('morphCSS3').cancel().setOptions(options); + return this; + }, + get: function(){ + var morph = this.retrieve('morphCSS3'); + if (!morph){ + morph = new Fx.Morph.CSS3(this, {link: 'cancel'}); + this.store('morphCSS3', morph); + } + return morph; + } + + }; + Element.implement({ + tweenCSS3: function(property, from, to){ + this.get('tweenCSS3').start(property, from, to); + return this; + }, + morphCSS3: function(props){ + this.get('morphCSS3').start(props); + return this; + } + }); })(); \ No newline at end of file