File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 139
139
var maxLeft = this . left && this . left . width || 0 ;
140
140
var maxRight = this . right && this . right . width || 0 ;
141
141
142
+ console . log ( 'Opening amount' , amount ) ;
143
+
142
144
// Check if we can move to that side, depending if the left/right panel is enabled
143
- if ( ( ! ( this . left && this . left . isEnabled ) && amount > 0 ) || ( ! ( this . right && this . right . isEnabled ) && amount < 0 ) ) {
145
+ if ( ! ( this . left && this . left . isEnabled ) && amount > 0 ) {
146
+ this . content . setTranslateX ( 0 ) ;
147
+ return ;
148
+ }
149
+
150
+ if ( ! ( this . right && this . right . isEnabled ) && amount < 0 ) {
151
+ console . log ( 'Blocked right' ) ;
152
+ this . content . setTranslateX ( 0 ) ;
153
+ return ;
154
+ }
155
+
156
+ if ( this . _leftShowing && amount > maxLeft ) {
157
+ this . content . setTranslateX ( maxLeft ) ;
144
158
return ;
145
159
}
146
160
147
- if ( ( this . _leftShowing && amount > maxLeft ) || ( this . _rightShowing && amount < - maxRight ) ) {
161
+ if ( this . _rightShowing && amount < - maxRight ) {
162
+ this . content . setTranslateX ( - maxRight ) ;
148
163
return ;
149
164
}
150
165
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ <h1 class="title">Slide me</h1>
24
24
< h1 > Content</ h1 >
25
25
</ ion-content >
26
26
</ ion-pane >
27
- < ion-side-menu side ="left " width ="$root.menuWidth || 200 " ng-controller ="LeftCtrl ">
27
+
28
+ < ion-side-menu side ="left " width ="$root.menuWidth || 270 " ng-controller ="LeftCtrl ">
28
29
< header class ="bar bar-header bar-assertive ">
29
30
< h1 class ="title "> Left</ h1 >
30
31
</ header >
You can’t perform that action at this time.
0 commit comments