mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(ionSideMenu): add edge-drag-threshold, delegate edgeDragThreshold()
Closes #1570
This commit is contained in:
14
js/angular/controller/sideMenuController.js
vendored
14
js/angular/controller/sideMenuController.js
vendored
@@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user