yogevbd před 7 roky
rodič
revize
18af18b216
No account linked to committer's email address

+ 4
- 0
lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.h Zobrazit soubor

228
  */
228
  */
229
 @property (nonatomic, strong) UIColor * shadowColor;
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
  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.
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 Zobrazit soubor

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

+ 2
- 0
lib/ios/RNNSideMenuOptions.h Zobrazit soubor

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

+ 12
- 0
lib/ios/RNNSideMenuOptions.m Zobrazit soubor

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
 		[self resetOptions];
33
 		[self resetOptions];
26
 	}
34
 	}
27
 }
35
 }
29
 -(void)mergeWith:(NSDictionary *)otherOptions {
37
 -(void)mergeWith:(NSDictionary *)otherOptions {
30
 	self.leftSideVisible = [[otherOptions valueForKey:@"left"] valueForKey:@"visible"];
38
 	self.leftSideVisible = [[otherOptions valueForKey:@"left"] valueForKey:@"visible"];
31
 	self.rightSideVisible = [[otherOptions valueForKey:@"right"] valueForKey:@"visible"];
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
 -(void)resetOptions {
44
 -(void)resetOptions {
35
 	self.leftSideVisible = nil;
45
 	self.leftSideVisible = nil;
36
 	self.rightSideVisible = nil;
46
 	self.rightSideVisible = nil;
47
+	self.leftSideEnabled = nil;
48
+	self.rightSideEnabled = nil;
37
 }
49
 }
38
 
50
 
39
 @end
51
 @end