Skip to content

Commit 61a280b

Browse files
committed
fix(sideMenuContent): make dragContent default to true
1 parent eed6b19 commit 61a280b

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

js/ext/angular/src/directive/ionicSideMenu.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
6060

6161
$element.addClass('menu-content');
6262

63-
$scope.$watch(attr.dragContent, function(value) {
64-
$scope.dragContent = value;
65-
});
63+
if (angular.isDefined(attr.dragContent)) {
64+
$scope.$watch(attr.dragContent, function(value) {
65+
$scope.dragContent = value;
66+
});
67+
} else {
68+
$scope.dragContent = true;
69+
}
6670

6771
var defaultPrevented = false;
6872
var isDragging = false;
@@ -81,7 +85,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
8185
}
8286
isDragging = true;
8387
sideMenuCtrl._handleDrag(e);
84-
e.gesture.srcEvent.preventDefault();
88+
//e.gesture.srcEvent.preventDefault();
8589
}
8690
};
8791

js/ext/angular/test/sideMenu2.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
<view title="'Welcome'">
4444
<content has-header="true" padding="true">
4545
<p>Swipe to the right to reveal the left menu.</p>
46+
<div class="button" ng-click="sideMenuController.toggleLeft()" style="position: absolute; left: 100px; top: 200px;">
47+
Left Menu
48+
</div>
49+
<p ng-repeat="p in range">{{$index}}....</p>
4650
<p>(On desktop click and drag from left to right)</p>
4751
</content>
4852
</view>
@@ -153,6 +157,9 @@
153157
.controller('MainCtrl', function($scope) {
154158
console.log('MainCtrl');
155159

160+
$scope.range = [];
161+
for (var i=0; i<150; i++) $scope.range.push(i);
162+
156163
$scope.attendees = [
157164
{ firstname: 'Nicolas', lastname: 'Cage' },
158165
{ firstname: 'Jean-Claude', lastname: 'Van Damme' },

0 commit comments

Comments
 (0)