Skip to content

Commit

Permalink
fix(sideMenuContent): make dragContent default to true
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Feb 11, 2014
1 parent eed6b19 commit 61a280b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 8 additions & 4 deletions js/ext/angular/src/directive/ionicSideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie

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

$scope.$watch(attr.dragContent, function(value) {
$scope.dragContent = value;
});
if (angular.isDefined(attr.dragContent)) {
$scope.$watch(attr.dragContent, function(value) {
$scope.dragContent = value;
});
} else {
$scope.dragContent = true;
}

var defaultPrevented = false;
var isDragging = false;
Expand All @@ -81,7 +85,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
}
isDragging = true;
sideMenuCtrl._handleDrag(e);
e.gesture.srcEvent.preventDefault();
//e.gesture.srcEvent.preventDefault();
}
};

Expand Down
7 changes: 7 additions & 0 deletions js/ext/angular/test/sideMenu2.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<view title="'Welcome'">
<content has-header="true" padding="true">
<p>Swipe to the right to reveal the left menu.</p>
<div class="button" ng-click="sideMenuController.toggleLeft()" style="position: absolute; left: 100px; top: 200px;">
Left Menu
</div>
<p ng-repeat="p in range">{{$index}}....</p>
<p>(On desktop click and drag from left to right)</p>
</content>
</view>
Expand Down Expand Up @@ -153,6 +157,9 @@
.controller('MainCtrl', function($scope) {
console.log('MainCtrl');

$scope.range = [];
for (var i=0; i<150; i++) $scope.range.push(i);

$scope.attendees = [
{ firstname: 'Nicolas', lastname: 'Cage' },
{ firstname: 'Jean-Claude', lastname: 'Van Damme' },
Expand Down

0 comments on commit 61a280b

Please sign in to comment.