mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
multiple panes updates
This commit is contained in:
@@ -42,6 +42,7 @@ export class ViewController extends Ion {
|
||||
|
||||
this.id = ++ctrlIds;
|
||||
this._ids = -1;
|
||||
this.zIndexes = -1;
|
||||
|
||||
// build a new injector for child ViewItems to use
|
||||
this.bindings = Injector.resolve([
|
||||
|
||||
@@ -74,11 +74,18 @@ export class ViewItem {
|
||||
contentContainer.createHostView(hostProtoViewRef, -1, bindings);
|
||||
var newLocation = viewCtrl.viewMngr.getHostElement(hostViewRef);
|
||||
var newComponent = viewCtrl.viewMngr.getComponent(newLocation);
|
||||
pane.totalItems++;
|
||||
|
||||
var dispose = () => {
|
||||
var index = contentContainer.indexOf(hostViewRef);
|
||||
if (index !== -1) {
|
||||
contentContainer.remove(index);
|
||||
|
||||
// remove the pane if there are no view items left
|
||||
pane.totalItems--;
|
||||
if (pane.totalItems === 0) {
|
||||
pane.dispose();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.disposals.push(dispose);
|
||||
@@ -100,7 +107,10 @@ export class ViewItem {
|
||||
let navbarView = navbarViewContainer.createEmbeddedView(navbarTemplateRef, -1);
|
||||
|
||||
this.disposals.push(() => {
|
||||
navbarViewContainer.remove( navbarViewContainer.indexOf(navbarView) );
|
||||
let index = navbarViewContainer.indexOf(navbarView);
|
||||
if (index > -1) {
|
||||
navbarViewContainer.remove(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -280,9 +290,6 @@ export class ViewItem {
|
||||
will fire, whether it was the first load or loaded from the cache.
|
||||
*/
|
||||
didEnter() {
|
||||
if (this.pane) {
|
||||
this.pane.showPane = true;
|
||||
}
|
||||
let navbarView = this.navbarView();
|
||||
if (navbarView) {
|
||||
navbarView.didEnter();
|
||||
|
||||
Reference in New Issue
Block a user