Skip to content

Commit ea04e39

Browse files
committed
fix(sideMenuController): sticking issue #738
1 parent 1b72779 commit ea04e39

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Diff for: js/controllers/sideMenuController.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,27 @@
139139
var maxLeft = this.left && this.left.width || 0;
140140
var maxRight = this.right && this.right.width || 0;
141141

142+
console.log('Opening amount', amount);
143+
142144
// 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);
144158
return;
145159
}
146160

147-
if((this._leftShowing && amount > maxLeft) || (this._rightShowing && amount < -maxRight)) {
161+
if(this._rightShowing && amount < -maxRight) {
162+
this.content.setTranslateX(-maxRight);
148163
return;
149164
}
150165

Diff for: js/ext/angular/test/sideMenu.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ <h1 class="title">Slide me</h1>
2424
<h1>Content</h1>
2525
</ion-content>
2626
</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">
2829
<header class="bar bar-header bar-assertive">
2930
<h1 class="title">Left</h1>
3031
</header>

0 commit comments

Comments
 (0)