Skip to content

Commit

Permalink
Added transition_reverse option to support different option settings …
Browse files Browse the repository at this point in the history
…for reverse call
  • Loading branch information
ydaniv committed Mar 4, 2015
1 parent 56a282e commit 5a11bb4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/animation/velocity.js
Expand Up @@ -41,7 +41,7 @@
transit : function (widget, direction, callback) {
var transit_type = widget.options.transition || this.options.transition,
$el = (widget.$wrapper || widget.$element),
is_direction_in, result;
is_direction_in, result, options;

direction = direction || 'in';
is_direction_in = direction == 'in';
Expand Down Expand Up @@ -69,7 +69,11 @@
}
}
else {
result = Velocity.animate($el[0], 'reverse', (callback && { complete : callback }));
options = widget.options.transition_reverse || {};
if ( callback ) {
options.complete = callback;
}
result = Velocity.animate($el[0], 'reverse', options);
}

return result;
Expand Down

0 comments on commit 5a11bb4

Please sign in to comment.