mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
tab navbars
This commit is contained in:
@@ -40,7 +40,6 @@ export class Navbar {
|
||||
constructor(item: ViewItem, elementRef: ElementRef) {
|
||||
item.navbarElement(elementRef.domElement);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Directive({
|
||||
|
||||
@@ -212,7 +212,7 @@ export class ViewController {
|
||||
let swipeBackPromise = new Promise(res => { this.sbResolve = res; });
|
||||
|
||||
swipeBackPromise.then((completeSwipeBack) => {
|
||||
console.log('completeSwipeBack', completeSwipeBack)
|
||||
|
||||
if (completeSwipeBack) {
|
||||
// swipe back has completed, update each item's state
|
||||
enteringItem.state = ACTIVE_STATE;
|
||||
|
||||
@@ -199,29 +199,78 @@ export class ViewItem {
|
||||
navbarElement() {
|
||||
if (arguments.length) {
|
||||
this._nbEle = arguments[0];
|
||||
return;
|
||||
}
|
||||
if (this._nbEle) {
|
||||
// this ViewItem already has an assigned navbarElement
|
||||
return this._nbEle;
|
||||
}
|
||||
|
||||
let instance = this.instance;
|
||||
if (instance && instance.parentNavbar && instance.parentNavbar()) {
|
||||
// this View doesn't actually have it's own navbar
|
||||
// for example, Tab does not have a navbar, but Tabs does
|
||||
// so if this is true, then get the active ViewItem inside this instance
|
||||
let activeChildViewItem = instance.getActive();
|
||||
if (activeChildViewItem) {
|
||||
return activeChildViewItem.navbarElement();
|
||||
}
|
||||
}
|
||||
return this._nbEle;
|
||||
}
|
||||
|
||||
titleElement() {
|
||||
if (arguments.length) {
|
||||
this._ttEle = arguments[0];
|
||||
return;
|
||||
}
|
||||
if (this._ttEle) {
|
||||
return this._ttEle;
|
||||
}
|
||||
|
||||
let instance = this.instance;
|
||||
if (instance && instance.parentNavbar && instance.parentNavbar()) {
|
||||
let activeChildViewItem = instance.getActive();
|
||||
if (activeChildViewItem) {
|
||||
return activeChildViewItem.titleElement();
|
||||
}
|
||||
}
|
||||
return this._ttEle;
|
||||
}
|
||||
|
||||
backButtonElement() {
|
||||
if (arguments.length) {
|
||||
this._bbEle = arguments[0];
|
||||
return;
|
||||
}
|
||||
if (this._bbEle) {
|
||||
return this._bbEle;
|
||||
}
|
||||
|
||||
let instance = this.instance;
|
||||
if (instance && instance.parentNavbar && instance.parentNavbar()) {
|
||||
let activeChildViewItem = instance.getActive();
|
||||
if (activeChildViewItem) {
|
||||
return activeChildViewItem.backButtonElement();
|
||||
}
|
||||
}
|
||||
return this._bbEle;
|
||||
}
|
||||
|
||||
navbarItemElements() {
|
||||
if (arguments.length) {
|
||||
this._nbItms.push(arguments[0]);
|
||||
return;
|
||||
}
|
||||
if (this._nbItms) {
|
||||
return this._nbItms;
|
||||
}
|
||||
|
||||
|
||||
let instance = this.instance;
|
||||
if (instance && instance.parentNavbar && instance.parentNavbar()) {
|
||||
let activeChildViewItem = instance.getActive();
|
||||
if (activeChildViewItem) {
|
||||
return activeChildViewItem.navbarItemElements();
|
||||
}
|
||||
}
|
||||
return this._nbItms;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user