Last active
August 29, 2015 14:16
-
-
Save ajoslin/ef744c0cdfc3d71377d3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/*************************** | |
* IONIC INTERNAL CONFIG | |
***************************/ | |
import {TabsConfig} from 'ionic/components/tabs'; | |
function MaterialTabsMixin(tabsInstance) { | |
Pannable(tabsInstance); | |
return { | |
onPanStart() {}, | |
onPan() {}, | |
onPanEnd() {} | |
}; | |
} | |
TabsConfig.platform('android') | |
.mixin(MaterialTabsMixin) | |
.set({ showStripe: true }); | |
/*************************** | |
* DEVELOPER'S CONFIG | |
***************************/ | |
// When 'superAnimation' is set in config, use my mixin on tabs | |
TabsConfig.when('superAnimation').mixin(superAnimationMixin); | |
// Always show the material design stripe on large screens, no matter the platform. | |
TabsConfig.media('lg').set({ showStripe: true }) |
This file contains hidden or 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
<!-- plain config of instance --> | |
<ion-tabs [config]="{ showStripe: true }" /> | |
<!-- Use the user-defined superAnimationMixin --> | |
<ion-tabs [config]="{ superAnimation: true }" /> | |
<!-- Activate the user-defined superAnimation mixin on android --> | |
<ion-tabs [config-platform-android]="{ superAnimation: true }" /> | |
<!-- show the stripe on these tabs on desktop --> | |
<ion-tabs [config-media-lg]="{ showStripe: true }" /> |
This file contains hidden or 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
// This would imperatively activate the superAnimation mixin on android for this instance | |
myTabsInstance.$config.platform('android').set({ | |
superAnimation: true | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment