Skip to content

Commit

Permalink
feat(split-panel): split panel support for ion-nav and ion-menu (#10343)
Browse files Browse the repository at this point in the history
* feat(split-panel): split panel support for ion-nav and ion-menu

Revert some changes

adds support split-panel support for tabs

Removes .orig

removes e2e.ts

Removes unneeded changes in menu.ts

improves stuff

* fix(split-panel): resize is called when menu wraps a ion-nav

* test(split-panel): improves split-panel/basic test

* feat(split-panel): ionChange is an ng2 @output()

* fix(split-panel): fix tabs as side content

* fix(menu): forzedClose works as expected

* feat(split-panel): split-panel works with several menus

* chore(split-panel): renames to split-pane

* refactor(split-pane): splitPane can be injected

* fix(split-pane): it is a directive

* fix(slides): integration with split-panel

* Make gulp validate happy
  • Loading branch information
manucorporat committed Mar 3, 2017
1 parent 66fcaa7 commit 9e4c3a6
Show file tree
Hide file tree
Showing 36 changed files with 1,115 additions and 94 deletions.
14 changes: 12 additions & 2 deletions src/animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,18 @@ export class Animation {
});
}

syncPlay() {
// If the animation was already invalidated (it did finish), do nothing
if (!this.plt) {
return;
}
const opts = { duration: 0 };
this._isAsync = false;
this._clearAsync();
this._playInit(opts);
this._playDomInspect(opts);
}

/**
* @private
* DOM WRITE
Expand Down Expand Up @@ -569,7 +581,6 @@ export class Animation {
return true;
}
}

return false;
}

Expand All @@ -589,7 +600,6 @@ export class Animation {
return true;
}
}

return false;
}

Expand Down
5 changes: 3 additions & 2 deletions src/components/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ export class App {

runInDev(() => {
// During developement, navPop can be triggered by calling
if (!(<any>_plt.win())['HWBackButton']) {
(<any>_plt.win())['HWBackButton'] = () => {
const win = <any>_plt.win();
if (!win['HWBackButton']) {
win['HWBackButton'] = () => {
let p = this.goBack();
p && p.catch(() => console.debug('hardware go back cancelled'));
return p;
Expand Down
17 changes: 17 additions & 0 deletions src/components/menu/menu-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,23 @@ export class MenuController {
removeArrayItem(this._menus, menu);
}

/**
* @private
*/
_setActiveMenu(menu: Menu) {
assert(menu.enabled);
assert(this._menus.indexOf(menu) >= 0, 'menu is not registered');

// if this menu should be enabled
// then find all the other menus on this same side
// and automatically disable other same side menus
const side = menu.side;
this._menus
.filter(m => m.side === side && m !== menu)
.map(m => m.enable(false));
}


/**
* @private
*/
Expand Down
7 changes: 5 additions & 2 deletions src/components/menu/menu-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,24 @@ export class MenuToggle {
*/
@HostListener('click')
toggle() {
let menu = this._menu.get(this.menuToggle);
const menu = this._menu.get(this.menuToggle);
menu && menu.toggle();
}

/**
* @private
*/
get isHidden() {
const menu = this._menu.get(this.menuToggle);
if (!menu || !menu._canOpen()) {
return true;
}
if (this._inNavbar && this._viewCtrl) {
if (this._viewCtrl.isFirst()) {
// this is the first view, so it should always show
return false;
}

let menu = this._menu.get(this.menuToggle);
if (menu) {
// this is not the root view, so see if this menu
// is configured to still be enabled if it's not the root view
Expand Down
6 changes: 3 additions & 3 deletions src/components/menu/menu-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export class MenuType {
}

setOpen(shouldOpen: boolean, animated: boolean, done: Function) {
let ani = this.ani
.onFinish(done, true)
const ani = this.ani
.onFinish(done, true, true)
.reverse(!shouldOpen);

if (animated) {
ani.play();
} else {
ani.play({ duration: 0 });
ani.syncPlay();
}
}

Expand Down
Loading

0 comments on commit 9e4c3a6

Please sign in to comment.