Skip to content

Commit e3db085

Browse files
committed
fix(sideMenu): when drag-content=false, allow drag-to-close
Closes #1419
1 parent 685111e commit e3db085

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: js/angular/controller/sideMenuController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform) {
3838
};
3939

4040
this.isDraggableTarget = function(e) {
41-
return $scope.dragContent &&
41+
return (self.isOpen() || $scope.dragContent) &&
4242
(!e.gesture.srcEvent.defaultPrevented &&
4343
!e.target.tagName.match(/input|textarea|select|object|embed/i) &&
4444
!e.target.isContentEditable &&

Diff for: test/html/sideMenu.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
<ion-side-menus>
1515

16-
<ion-side-menu-content edge-drag-threshold="true">
16+
<ion-side-menu-content edge-drag-threshold="true" drag-content="!$root.disableDrag">
1717
<header class="bar bar-header bar-positive">
1818
<button class="button button-icon ion-navicon" ng-click="toggleLeft()"></button>
1919
<h1 class="title">Slide me</h1>
2020
<button class="button button-icon ion-navicon" ng-click="toggleRight()"></button>
2121
</header>
2222
<ion-content class="has-header">
23-
<ion-toggle ng-model="$root.$draggy">Hello</ion-toggle>
23+
<ion-toggle ng-model="$root.disableDrag">Disable Drag Content?</ion-toggle>
2424
<input type="range" ng-model="$root.menuWidth" min="0" max="300">
2525
<h1>Content</h1>
2626
<ion-list>

0 commit comments

Comments
 (0)