Skip to content

Commit

Permalink
fix(menu): push/overlay working correctly in landscape
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Jun 16, 2016
1 parent 87812f3 commit 0c88589
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
11 changes: 6 additions & 5 deletions src/components/menu/menu-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ class MenuPushType extends MenuType {
let contentOpenedX: string, menuClosedX: string, menuOpenedX: string;

if (menu.side === 'right') {
// right side
contentOpenedX = -menu.width() + 'px';
menuOpenedX = (platform.width() - menu.width()) + 'px';
menuClosedX = platform.width() + 'px';
menuClosedX = menu.width() + 'px';
menuOpenedX = '0px';

} else {
contentOpenedX = menu.width() + 'px';
Expand Down Expand Up @@ -137,13 +138,13 @@ class MenuOverlayType extends MenuType {
let closedX: string, openedX: string;
if (menu.side === 'right') {
// right side
closedX = menu.width() + 'px';
closedX = 8 + menu.width() + 'px';
openedX = '0px';

} else {
// left side
closedX = -menu.width() + 'px';
openedX = '8px';
closedX = -(8 + menu.width()) + 'px';
openedX = '0px';
}

let menuAni = new Animation(menu.getMenuElement());
Expand Down
10 changes: 0 additions & 10 deletions src/components/menu/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ ion-menu[type=reveal].show-menu {
// itself, which is under the menu, does not move.

ion-menu[type=overlay] {
left: -8px; // make up for the box-shadow hanging over on the left
z-index: $z-index-menu-overlay;

ion-backdrop {
Expand All @@ -88,12 +87,3 @@ ion-menu[type=overlay] {
}
}
}

ion-menu[type=overlay][side=right] {
left: auto;
right: -8px;
}

ion-menu[type=push][side=right] {
left: 0;
}

0 comments on commit 0c88589

Please sign in to comment.