commit of code

This commit is contained in:
Adam Bradley
2015-06-04 13:56:03 -05:00
parent 604ed818c8
commit 1f97c0850e
4 changed files with 12 additions and 112 deletions

View File

@ -26,8 +26,8 @@ import {IonicComponent} from 'ionic/config/component';
hostProperties: {
'panelId': 'attr.id',
'labeledBy': 'attr.aria-labelledby',
'ariaHidden': 'attr.aria-hidden',
'isSelected': 'class.show-tab'
'!isSelected': 'attr.aria-hidden',
'isSelected': 'class.tab-selected'
},
hostAttributes: {
'role': 'tabpanel'
@ -58,7 +58,6 @@ export class Tab {
this.navBase.panes['_n'] = this;
this.isSelected = false;
this.ariaHidden = true;
tabs.addTab(this);
this.panelId = 'tab-panel-' + this.id;
@ -83,7 +82,6 @@ export class Tab {
}
this.isSelected = shouldSelect;
this.ariaHidden = !shouldSelect;
}
}

View File

@ -47,6 +47,7 @@ export class Tabs {
this.id = ++tabsId;
this.tabIds = 0;
this.tabs = [];
this._selected = null;
this.domElement = elementRef.domElement;
this.config = Tabs.config.invoke(this);
@ -75,6 +76,8 @@ export class Tabs {
}
if (!tabToSelect || this._selected === tabToSelect) return;
let tabToDeselect = this._selected;
this.tabs.forEach(tab => {
tab.select( (tab === tabToSelect) );
});

View File

@ -4,7 +4,13 @@
<ion-tab [initial]="tab1Initial" tab-title="Tab 1">
</ion-tab>
<ion-tab [initial]="tab2Initial" tab-title="Tab 2">
<ion-tab [initial]="tab2Initial" tab-title="Tab 2" class="tab2">
</ion-tab>
</ion-tabs>
<style>
.tab2 f {
background: green
}
</style>