feat(ionSideMenu): add edge-drag-threshold, delegate edgeDragThreshold()

Closes #1570
This commit is contained in:
MGMsystems
2014-06-04 13:41:56 +02:00
committed by Andrew
parent ba1859b308
commit ba56bb983f
5 changed files with 59 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform) {
extend(this, ionic.controllers.SideMenuController.prototype);
this.$scope = $scope;
this.dragThreshold = 25;
ionic.controllers.SideMenuController.call(this, {
left: { width: 275 },
@@ -22,6 +23,19 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform) {
return $scope.dragContent;
};
this.dragThreshold = 25;
this.edgeDragThreshold = function(value) {
if (arguments.length) {
if (angular.isNumber(value) && value > 0) {
this.dragThreshold = value;
this.dragOnlyEdge = true;
} else {
this.dragOnlyEdge = !!value;
}
}
return this.dragOnlyEdge;
};
this.isDraggableTarget = function(e) {
return $scope.dragContent &&
(!e.gesture.srcEvent.defaultPrevented &&