Skip to content

Commit

Permalink
fix(sideMenu): when drag-content=false, allow drag-to-close
Browse files Browse the repository at this point in the history
Closes #1419
  • Loading branch information
ajoslin committed Jul 7, 2014
1 parent 685111e commit e3db085
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/angular/controller/sideMenuController.js
Expand Up @@ -38,7 +38,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform) {
};

this.isDraggableTarget = function(e) {
return $scope.dragContent &&
return (self.isOpen() || $scope.dragContent) &&
(!e.gesture.srcEvent.defaultPrevented &&
!e.target.tagName.match(/input|textarea|select|object|embed/i) &&
!e.target.isContentEditable &&
Expand Down
4 changes: 2 additions & 2 deletions test/html/sideMenu.html
Expand Up @@ -13,14 +13,14 @@

<ion-side-menus>

<ion-side-menu-content edge-drag-threshold="true">
<ion-side-menu-content edge-drag-threshold="true" drag-content="!$root.disableDrag">
<header class="bar bar-header bar-positive">
<button class="button button-icon ion-navicon" ng-click="toggleLeft()"></button>
<h1 class="title">Slide me</h1>
<button class="button button-icon ion-navicon" ng-click="toggleRight()"></button>
</header>
<ion-content class="has-header">
<ion-toggle ng-model="$root.$draggy">Hello</ion-toggle>
<ion-toggle ng-model="$root.disableDrag">Disable Drag Content?</ion-toggle>
<input type="range" ng-model="$root.menuWidth" min="0" max="300">
<h1>Content</h1>
<ion-list>
Expand Down

0 comments on commit e3db085

Please sign in to comment.