Skip to content

Instantly share code, notes, and snippets.

@omghax
Created April 10, 2018 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omghax/34f64eb026a3962b0c3c9bee8f36dc1c to your computer and use it in GitHub Desktop.
Save omghax/34f64eb026a3962b0c3c9bee8f36dc1c to your computer and use it in GitHub Desktop.
import Controller from '@ember/controller';
import { toLeft, toRight } from 'ember-animated/transitions/move-over';
export default Controller.extend({
activeTab: 1,
rules({ firstTime, newItem, oldItem }) {
// Only animate on change, not on the initial value.
if (firstTime) {
return;
}
// Higher-numbered tabs slide in from the right, lower from the left.
return newItem > oldItem ? toLeft : toRight;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment