yogevbd 6 년 전
부모
커밋
18af18b216
No account linked to committer's email address

+ 4
- 0
lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.h 파일 보기

@@ -228,6 +228,10 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
228 228
  */
229 229
 @property (nonatomic, strong) UIColor * shadowColor;
230 230
 
231
+@property (nonatomic, assign) BOOL leftSideEnabled;
232
+
233
+@property (nonatomic, assign) BOOL rightSideEnabled;
234
+
231 235
 /**
232 236
  The flag determining if a custom background view should appear beneath the status bar, forcing the child content to be drawn lower than the status bar.
233 237
  

+ 7
- 0
lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.m 파일 보기

@@ -233,6 +233,8 @@ static NSString *MMDrawerOpenSideKey = @"MMDrawerOpenSide";
233 233
     
234 234
     // set defualt panVelocityXAnimationThreshold
235 235
     [self setPanVelocityXAnimationThreshold:MMDrawerPanVelocityXAnimationThreshold];
236
+	
237
+	_rightSideEnabled = _leftSideEnabled = YES;
236 238
 }
237 239
 
238 240
 #pragma mark - State Restoration
@@ -1126,6 +1128,11 @@ static NSString *MMDrawerOpenSideKey = @"MMDrawerOpenSide";
1126 1128
                 visibleSide = MMDrawerSideRight;
1127 1129
                 percentVisible = ABS(xOffset)/self.maximumRightDrawerWidth;
1128 1130
             }
1131
+			
1132
+			if ((!_leftSideEnabled && visibleSide == MMDrawerSideLeft) || (!_rightSideEnabled && visibleSide == MMDrawerSideRight)) {
1133
+				return;
1134
+			}
1135
+			
1129 1136
             UIViewController * visibleSideDrawerViewController = [self sideDrawerViewControllerForSide:visibleSide];
1130 1137
             
1131 1138
             if(self.openSide != visibleSide){

+ 2
- 0
lib/ios/RNNSideMenuOptions.h 파일 보기

@@ -4,5 +4,7 @@
4 4
 
5 5
 @property (nonatomic, strong) NSNumber* leftSideVisible;
6 6
 @property (nonatomic, strong) NSNumber* rightSideVisible;
7
+@property (nonatomic, strong) NSNumber* rightSideEnabled;
8
+@property (nonatomic, strong) NSNumber* leftSideEnabled;
7 9
 
8 10
 @end

+ 12
- 0
lib/ios/RNNSideMenuOptions.m 파일 보기

@@ -22,6 +22,14 @@
22 22
 			}
23 23
 		}
24 24
 		
25
+		if (self.leftSideEnabled) {
26
+			sideMenuController.sideMenu.leftSideEnabled = [self.leftSideEnabled boolValue];
27
+		}
28
+		
29
+		if (self.rightSideEnabled) {
30
+			sideMenuController.sideMenu.rightSideEnabled = [self.rightSideEnabled boolValue];
31
+		}
32
+		
25 33
 		[self resetOptions];
26 34
 	}
27 35
 }
@@ -29,11 +37,15 @@
29 37
 -(void)mergeWith:(NSDictionary *)otherOptions {
30 38
 	self.leftSideVisible = [[otherOptions valueForKey:@"left"] valueForKey:@"visible"];
31 39
 	self.rightSideVisible = [[otherOptions valueForKey:@"right"] valueForKey:@"visible"];
40
+	self.leftSideEnabled = [[otherOptions valueForKey:@"left"] valueForKey:@"enabled"];
41
+	self.rightSideEnabled = [[otherOptions valueForKey:@"right"] valueForKey:@"enabled"];
32 42
 }
33 43
 
34 44
 -(void)resetOptions {
35 45
 	self.leftSideVisible = nil;
36 46
 	self.rightSideVisible = nil;
47
+	self.leftSideEnabled = nil;
48
+	self.rightSideEnabled = nil;
37 49
 }
38 50
 
39 51
 @end