NavItem renamed to ViewItem

This commit is contained in:
Adam Bradley
2015-06-09 13:14:53 -05:00
parent b28bd21ad0
commit 359ab9d5c1
11 changed files with 155 additions and 131 deletions

View File

@@ -10,7 +10,7 @@ import {ViewContainerRef} from 'angular2/src/core/compiler/view_container_ref';
import {ViewController} from '../view/view-controller';
import {Tabs} from './tabs';
import {NavItem} from '../nav/nav-item';
import {ViewItem} from '../view/view-item';
import {Content} from '../content/content';
import {IonicComponent} from '../../config/component';
@@ -53,14 +53,14 @@ export class Tab extends ViewController {
super(tabs, compiler, elementRef, loader, injector);
this.tabs = tabs;
this.item = new NavItem(tabs.parent);
this.item.setInstance(this);
this.item.setViewElement(elementRef.domElement);
this.panes['_n'] = this;
let item = this.item = new ViewItem(tabs.parent);
item.setInstance(this);
item.setViewElement(elementRef.domElement);
this.panes.add(this)
tabs.addTab(this.item);
this.panelId = 'tab-panel-' + this.item.id;
this.labeledBy = 'tab-button-' + this.item.id;
this.panelId = 'tab-panel-' + item.id;
this.labeledBy = 'tab-button-' + item.id;
}
onInit() {

View File

@@ -10,9 +10,9 @@ import {NgFor} from 'angular2/angular2';
import {ViewContainerRef} from 'angular2/src/core/compiler/view_container_ref';
import {ViewController} from '../view/view-controller';
import {ViewItem} from '../view/view-item';
import {TabButton} from './tab-button';
import {Icon} from '../icon/icon';
import {NavItem} from '../nav/nav-item';
import {IonicComponent} from '../../config/component';
@@ -43,14 +43,14 @@ export class Tabs extends ViewController {
constructor(
@Optional() viewController: ViewController,
@Optional() navItem: NavItem,
@Optional() item: ViewItem,
compiler: Compiler,
elementRef: ElementRef,
loader: DynamicComponentLoader,
injector: Injector
) {
super(viewController, compiler, elementRef, loader, injector);
this.item = navItem;
this.item = item;
this.domElement = elementRef.domElement;
this.config = Tabs.config.invoke(this);
@@ -82,7 +82,7 @@ export class Tabs extends ViewController {
animate: false
};
let leavingItem = this.getActive() || new NavItem();
let leavingItem = this.getActive() || new ViewItem();
leavingItem.shouldDestroy = false;
leavingItem.shouldCache = true;
leavingItem.willCache();