Skip to content

Commit

Permalink
Removed running of callbacks from the transition function
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Caldwell committed Apr 2, 2011
1 parent 9067126 commit 5b7c4fc
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SparkFn.transition = function(method, timeframe, easing, callback) {
Spark(element).css({height: 0});

// Slide height to original
Spark(element).animate({height: original}, timeframe, easing, callback);
Spark(element).animate({height: original}, timeframe, easing);
}
else if(method === 'slideup') {
// Get original height
Expand All @@ -56,26 +56,20 @@ SparkFn.transition = function(method, timeframe, easing, callback) {
Spark(element).animate({height: 0}, timeframe, easing, function() {
// Set height to original
Spark(element).css({height: original + 'px', display: 'none'});

// Run the callback
callback();
});
}
else if(method === 'fadein') {
// Display it
Spark(element).css({display: 'block', opacity: 0});

// Fade opacity to 100
Spark(element).animate({opacity: 1}, timeframe, easing, callback);
Spark(element).animate({opacity: 1}, timeframe, easing);
}
else if(method === 'fadeout') {
// Fade opacity to 0
Spark(element).animate({opacity: 0}, timeframe, easing, function() {
// Set opacity to 100
Spark(element).css({opacity: 1, display: 'none'});

// Run the callback
callback();
});
}
else if(method === 'sneakin') {
Expand All @@ -89,7 +83,7 @@ SparkFn.transition = function(method, timeframe, easing, callback) {
Spark(element).css({height: 0});

// Slide height to original
Spark(element).animate({height: original, opacity: 1}, timeframe, easing, callback);
Spark(element).animate({height: original, opacity: 1}, timeframe, easing);
}
else if(method === 'sneakout') {
// Get original height
Expand All @@ -102,24 +96,15 @@ SparkFn.transition = function(method, timeframe, easing, callback) {
Spark(element).animate({height: 0, opacity: 0}, timeframe, easing, function() {
// Set height to original
Spark(element).css({height: original + 'px', display: 'none'});

// Run the callback
callback();
});
}
else if(method === 'show') {
// Show the element
Spark(element).css({display: 'block'});

// Run the callback
callback();
}
else if(method === 'hide') {
// Hide the element
Spark(element).css({display: 'none'});

// Run the callback
callback();
}
}
}
Expand Down

0 comments on commit 5b7c4fc

Please sign in to comment.