CSS3 IE tween support
This commit is contained in:
@@ -16,9 +16,10 @@ provides: [Fx.Tween]
|
||||
Element.NativeEvents.transitionend = 2;
|
||||
Element.NativeEvents.webkitTransitionEnd = 2;
|
||||
Element.NativeEvents.oTransitionEnd = 2;
|
||||
Element.NativeEvents.msTransitionEnd = 2;
|
||||
|
||||
Element.Events.transitionend = {
|
||||
base: Browser.safari || Browser.chrome ? 'webkitTransitionEnd' : (Browser.opera ? 'oTransitionEnd' : 'transitionend')
|
||||
base: Browser.safari || Browser.chrome ? 'webkitTransitionEnd' : (Browser.opera ? 'oTransitionEnd' : (Browser.ie && Browser.version > 8 ? 'msTransitionEnd' : 'transitionend'))
|
||||
};
|
||||
|
||||
Event.implement({
|
||||
@@ -37,12 +38,12 @@ Element.implement({
|
||||
|
||||
supportStyle: function(style){
|
||||
var value = this.style[style];
|
||||
return !!(value || value == '');
|
||||
return !!(value || value === '');
|
||||
},
|
||||
|
||||
supportVendorStyle: function(style){
|
||||
var prefixedStyle = null;
|
||||
return this.supportStyle(style) ? style : ['webkit', 'Moz', 'o'].some(function(prefix){
|
||||
return this.supportStyle(style) ? style : ['webkit', 'Moz', 'o', 'ms'].some(function(prefix){
|
||||
prefixedStyle = prefix + style.capitalize();
|
||||
return this.supportStyle(prefixedStyle);
|
||||
}, this) ? prefixedStyle : null;
|
||||
@@ -107,21 +108,21 @@ Fx.Tween = new Class({
|
||||
if (event.getPropertyName() == this.property /* && event.getElapsedTime() == this.options.duration */ ){
|
||||
this.element.removeEvent('transitionend', this.boundComplete);
|
||||
this.boundComplete = null;
|
||||
this.fireEvent('complete', this.subject);
|
||||
this.fireEvent('complete', this);
|
||||
}
|
||||
}.bind(this);
|
||||
this.element.addEvent('transitionend', this.boundComplete);
|
||||
var trans = function(){
|
||||
this.element.setStyle(this.transition, this.property + ' ' + this.options.duration + 'ms cubic-bezier(' + this.transitionTimings[this.options.transition] + ')');
|
||||
this.element.setStyle(this.property, this.to[0].value + + this.options.unit);
|
||||
this.element.setStyle(this.property, this.to[0].value + this.options.unit);
|
||||
}.bind(this);
|
||||
if (args[1]){
|
||||
this.element.setStyle(this.transition, 'none');
|
||||
this.element.setStyle(this.property, this.from[0].value + + this.options.unit);
|
||||
this.element.setStyle(this.property, this.from[0].value + this.options.unit);
|
||||
trans.delay(0.1);
|
||||
} else
|
||||
trans();
|
||||
this.fireEvent('start', this.subject);
|
||||
this.fireEvent('start', this);
|
||||
return this;
|
||||
}
|
||||
return this.parent(property, from, to);
|
||||
@@ -137,4 +138,4 @@ Fx.Tween = new Class({
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user