Skip to content

Commit

Permalink
fix(split-pane): side=end works properly
Browse files Browse the repository at this point in the history
fixes #15013
  • Loading branch information
manucorporat committed Aug 7, 2018
1 parent 2ff585f commit dc50003
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 34 deletions.
2 changes: 1 addition & 1 deletion core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class Menu {
/**
* Which side of the view the menu should be placed. Default `"start"`.
*/
@Prop() side: Side = 'start';
@Prop({ reflectToAttr: true }) side: Side = 'start';

@Watch('side')
protected sideChanged() {
Expand Down
8 changes: 5 additions & 3 deletions core/src/components/split-pane/split-pane.ios.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@

@import "../../themes/ionic.globals.ios";
@import "./split-pane";
@import "./split-pane.ios.vars";

// Split Pane
// --------------------------------------------------

.split-pane-ios.split-pane-visible > .split-pane-side {
.split-pane-ios.split-pane-visible > .split-pane-side[side=start] {
min-width: $split-pane-ios-side-min-width;
max-width: $split-pane-ios-side-max-width;

border-right: $split-pane-ios-border;
border-left: 0;
}

.split-pane-ios.split-pane-visible > .split-pane-side[side=right] {
.split-pane-ios.split-pane-visible > .split-pane-side[side=end] {
min-width: $split-pane-ios-side-min-width;
max-width: $split-pane-ios-side-max-width;

border-right: 0;
border-left: $split-pane-ios-border;
}
7 changes: 5 additions & 2 deletions core/src/components/split-pane/split-pane.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
// Split Pane
// --------------------------------------------------

.split-pane-md.split-pane-visible > .split-pane-side {
.split-pane-md.split-pane-visible > .split-pane-side[side=start] {
min-width: $split-pane-md-side-min-width;
max-width: $split-pane-md-side-max-width;

border-right: $split-pane-md-border;
border-left: 0;
}

.split-pane-md.split-pane-visible > .split-pane-side[side=right] {
.split-pane-md.split-pane-visible > .split-pane-side[side=end] {
min-width: $split-pane-md-side-min-width;
max-width: $split-pane-md-side-max-width;

border-right: 0;
border-left: $split-pane-md-border;
}
29 changes: 2 additions & 27 deletions core/src/components/split-pane/split-pane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,16 @@
display: flex;

flex-shrink: 0;
order: -1;
}

.split-pane-side:not(ion-menu) {
display: none;
}

.split-pane-visible > .split-pane-side[side=start] {
@include multi-dir() {
order: -1;
}
order: -1;
}

.split-pane-visible > .split-pane-side[side=end] {
@include multi-dir() {
order: 1;
}
}

.split-pane-visible > .split-pane-side[side=left] {
@include ltr() {
order: -1;
}

@include rtl() {
order: 1;
}
}

.split-pane-visible > .split-pane-side[side=right] {
@include ltr() {
order: 1;
}

@include rtl() {
order: -1;
}
order: 1;
}
2 changes: 1 addition & 1 deletion core/src/components/split-pane/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ion-app>
<ion-split-pane id="splitPane">

<ion-menu side="start">
<ion-menu side="end">

<ion-header>
<ion-toolbar color="secondary">
Expand Down

0 comments on commit dc50003

Please sign in to comment.