mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
tab cleanup
This commit is contained in:
@ -51,26 +51,16 @@ export class Tab extends NavBase {
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
super(tabs, compiler, elementRef, loader, injector);
|
super(tabs, compiler, elementRef, loader, injector);
|
||||||
if (tabs.parent) {
|
this.tabs = tabs;
|
||||||
this.sections = tabs.parent.panes['_n'].sections;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.item = new NavItem(tabs.parent);
|
this.item = new NavItem(tabs.parent);
|
||||||
this.item.setInstance(this);
|
this.item.setInstance(this);
|
||||||
this.item.setViewElement(elementRef.domElement);
|
this.item.setViewElement(elementRef.domElement);
|
||||||
|
this.panes['_n'] = this;
|
||||||
tabs.addTab(this.item);
|
tabs.addTab(this.item);
|
||||||
this.tabs = tabs;
|
|
||||||
|
|
||||||
this.panelId = 'tab-panel-' + this.item.id;
|
this.panelId = 'tab-panel-' + this.item.id;
|
||||||
this.labeledBy = 'tab-button-' + this.item.id;
|
this.labeledBy = 'tab-button-' + this.item.id;
|
||||||
|
|
||||||
this.elementRef = elementRef;
|
|
||||||
|
|
||||||
this.viewContainerRef = viewContainerRef;
|
|
||||||
|
|
||||||
this.panes['_n'] = this;
|
|
||||||
|
|
||||||
this.domElement = elementRef.domElement;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
onInit() {
|
||||||
@ -107,6 +97,6 @@ export class Tab extends NavBase {
|
|||||||
})
|
})
|
||||||
class TabContentAnchor {
|
class TabContentAnchor {
|
||||||
constructor(@Parent() tab: Tab, viewContainerRef: ViewContainerRef) {
|
constructor(@Parent() tab: Tab, viewContainerRef: ViewContainerRef) {
|
||||||
tab.contentContainerRef = viewContainerRef;
|
this.contentContainerRef = viewContainerRef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,7 @@ export class Tabs extends NavBase {
|
|||||||
leavingItem.shouldCache = true;
|
leavingItem.shouldCache = true;
|
||||||
leavingItem.willCache();
|
leavingItem.willCache();
|
||||||
|
|
||||||
|
// set the Tab navbarView from the active view in the tab
|
||||||
enteringItem.navbarView = (enteringItem.instance.getActive() || {}).navbarView;
|
enteringItem.navbarView = (enteringItem.instance.getActive() || {}).navbarView;
|
||||||
if (leavingItem.instance) {
|
if (leavingItem.instance) {
|
||||||
leavingItem.navbarView = (leavingItem.instance.getActive() || {}).navbarView;
|
leavingItem.navbarView = (leavingItem.instance.getActive() || {}).navbarView;
|
||||||
|
Reference in New Issue
Block a user