JKnorr91 / ion-slide-box-tabs

An Add-On directive for the ion-slide-box, that adds tabs to the slide box, known from the Android Material Design specification
MIT License
248 stars 110 forks source link

Question: How to keep tab transition styles when procedurally changing slides? #18

Closed LuisMCunha closed 8 years ago

LuisMCunha commented 8 years ago

Due to design requirements, I had to add a next and previous buttons that allow the user to traverse the tabs, but was done using $ionicSlideBoxDelegate.next() and as $ionicSlideBoxDelegate.previous(), and when a tab switches to another, the css styling that moves the tab bar scroll and the one that indicates which tab is currently selected isn't applied. How would be a good way to do this so that the tab bar styles also applies when I procedurally change the current slide?

LuisMCunha commented 8 years ago

The solution I implemented was to add 2 additional angular.element() in the form of buttons to the left and right of the tabsBar and verify if it was a button that was pressed or if it was a swipe in the onTabTabbed function. Not sure if this was the best approach, but worked for my use case.