tiger
Version:
A full port of Spine.js MVC framework to Titanium Mobile, with enhancements
84 lines (77 loc) • 1.93 kB
JavaScript
// Generated by CoffeeScript 1.6.3
(function() {
var FX, Tiger;
Tiger = this.Tiger || require('./tiger');
FX = {
fadeIn: function(duration, callback) {
this.element.visible = true;
return this.fadeTo(1, duration, callback);
},
fadeOut: function(duration, callback) {
var cb,
_this = this;
cb = function() {
_this.element.visible = false;
if (callback) {
return callback();
}
};
return this.fadeTo(0, duration, cb);
},
fadeTo: function(opacity, duration, callback) {
return this.animate({
opacity: opacity,
duration: duration
}, callback);
},
slideUp: function(duration, callback) {
var cb,
_this = this;
cb = function() {
_this.element.visible = false;
if (callback) {
return callback();
}
};
return this.animate({
top: '-' + this.get('height'),
duration: duration
}, cb);
},
slideDown: function(duration, callback) {
this.element.visible = true;
return this.animate({
top: this.defaults.top,
duration: duration
}, callback);
},
slideFadeUp: function(duration, callback) {
var cb,
_this = this;
cb = function() {
_this.element.visible = false;
if (callback) {
return callback();
}
};
return this.animate({
top: '-' + this.get('height'),
opacity: 0,
duration: duration
}, cb);
},
slideFadeDown: function(duration, callback) {
this.element.visible = true;
return this.animate({
top: this.defaults.top,
opacity: 1,
duration: duration
}, callback);
}
};
Tiger.Element.include(FX);
Tiger.FX = FX;
if (typeof module !== "undefined" && module !== null) {
module.exports = FX;
}
}).call(this);