mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
tabs fixes
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import {NgElement, Component, Template, Parent} from 'angular2/angular2';
|
||||
import {History} from '../../history';
|
||||
import {Ion} from '../ion';
|
||||
import {View} from 'ionic/components/view/view';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -25,7 +26,7 @@ import {Ion} from '../ion';
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class Tabs extends View {
|
||||
export class Tabs extends Ion {
|
||||
|
||||
constructor(@NgElement() ele:NgElement) {
|
||||
ele.domElement.classList.add('view');
|
||||
@ -45,44 +46,3 @@ export class Tabs extends View {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'ion-tab',
|
||||
bind: {
|
||||
tabTitle: 'tab-title'
|
||||
}
|
||||
})
|
||||
@Template({
|
||||
inline: `
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div class="scroll-content">
|
||||
<content></content>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class Tab extends View {
|
||||
|
||||
constructor(@NgElement() ele:NgElement, @Parent() tabs: Tabs) {
|
||||
this.ele = ele;
|
||||
this.history = new History();
|
||||
|
||||
ele.domElement.classList.add('view');
|
||||
ele.domElement.classList.add('tab-view');
|
||||
|
||||
tabs.add(this);
|
||||
|
||||
setTimeout(() => {
|
||||
// HACK!!!!! "this" doesn't have tabTitle when not in setTimeout
|
||||
console.log(this.tabTitle)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
show(shouldShow) {
|
||||
this.ele.domElement.classList[shouldShow ? 'remove' : 'add']('hide');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user