mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(sideMenuController): sticking issue #738
This commit is contained in:
@@ -139,12 +139,27 @@
|
||||
var maxLeft = this.left && this.left.width || 0;
|
||||
var maxRight = this.right && this.right.width || 0;
|
||||
|
||||
console.log('Opening amount', amount);
|
||||
|
||||
// Check if we can move to that side, depending if the left/right panel is enabled
|
||||
if((!(this.left && this.left.isEnabled) && amount > 0) || (!(this.right && this.right.isEnabled) && amount < 0)) {
|
||||
if(!(this.left && this.left.isEnabled) && amount > 0) {
|
||||
this.content.setTranslateX(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if((this._leftShowing && amount > maxLeft) || (this._rightShowing && amount < -maxRight)) {
|
||||
if(!(this.right && this.right.isEnabled) && amount < 0) {
|
||||
console.log('Blocked right');
|
||||
this.content.setTranslateX(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if(this._leftShowing && amount > maxLeft) {
|
||||
this.content.setTranslateX(maxLeft);
|
||||
return;
|
||||
}
|
||||
|
||||
if(this._rightShowing && amount < -maxRight) {
|
||||
this.content.setTranslateX(-maxRight);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
<h1>Content</h1>
|
||||
</ion-content>
|
||||
</ion-pane>
|
||||
<ion-side-menu side="left" width="$root.menuWidth || 200" ng-controller="LeftCtrl">
|
||||
|
||||
<ion-side-menu side="left" width="$root.menuWidth || 270" ng-controller="LeftCtrl">
|
||||
<header class="bar bar-header bar-assertive">
|
||||
<h1 class="title">Left</h1>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user