Created
April 10, 2018 21:18
-
-
Save omghax/34f64eb026a3962b0c3c9bee8f36dc1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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