Skip to content

Commit

Permalink
Merge pull request #1 from ewanharris/fix_nav_window_usage
Browse files Browse the repository at this point in the history
fix: handle navigationwindows as left and right properties
  • Loading branch information
mbender74 authored Aug 7, 2021
2 parents 1763cc4 + e7743f7 commit 5275db7
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions ios/Classes/DkNappDrawerDrawer.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,24 @@ - (MMDrawerController *)controller

if (leftWindow != nil) {

BOOL leftIsNav = NO;
if ([[[leftWindow class] description] isEqualToString:@"TiUINavigationWindowProxy"]) {
leftIsNav = YES;
}

TiViewController *leftController = leftIsNav ? NavigationControllerForViewProxy(leftWindow) : ControllerForViewProxy(leftWindow);

//both left and right
if (rightWindow != nil) {

TiViewController *leftController = ControllerForViewProxy(leftWindow);
TiViewController *rightController = ControllerForViewProxy(rightWindow);
BOOL rightIsNav = NO;
if ([[[rightWindow class] description] isEqualToString:@"TiUINavigationWindowProxy"]) {
rightIsNav = YES;
}

TiUINavigationWindowProxy *centerProxy = [self.proxy valueForUndefinedKey:@"centerWindow"];
TiViewController *rightController = rightIsNav ? NavigationControllerForViewProxy(rightWindow) : ControllerForViewProxy(rightWindow);

TiUINavigationWindowProxy *centerProxy = [self.proxy valueForUndefinedKey:@"centerWindow"];

TiThreadPerformOnMainThread(^{
[centerProxy windowWillOpen];
Expand All @@ -126,9 +137,7 @@ - (MMDrawerController *)controller
//left only
} else {

TiViewController *leftController = ControllerForViewProxy(leftWindow);

TiUINavigationWindowProxy *centerProxy = [self.proxy valueForUndefinedKey:@"centerWindow"];
TiUINavigationWindowProxy *centerProxy = [self.proxy valueForUndefinedKey:@"centerWindow"];

TiThreadPerformOnMainThread(^{
[centerProxy windowWillOpen];
Expand All @@ -142,9 +151,14 @@ - (MMDrawerController *)controller
//right only
} else if (rightWindow != nil) {

TiViewController *rightController = ControllerForViewProxy(rightWindow);
BOOL rightIsNav = NO;
if ([[[rightWindow class] description] isEqualToString:@"TiUINavigationWindowProxy"]) {
rightIsNav = YES;
}

TiUINavigationWindowProxy *centerProxy = [self.proxy valueForUndefinedKey:@"centerWindow"];
TiViewController *rightController = rightIsNav ? NavigationControllerForViewProxy(rightWindow) : ControllerForViewProxy(rightWindow);

TiUINavigationWindowProxy *centerProxy = [self.proxy valueForUndefinedKey:@"centerWindow"];

TiThreadPerformOnMainThread(^{
[centerProxy windowWillOpen];
Expand Down

0 comments on commit 5275db7

Please sign in to comment.