Skip to content

Commit

Permalink
Revert "Merge pull request apache#272 from jcesarmobile/CB-12922"
Browse files Browse the repository at this point in the history
This reverts commit 9cc7f69, reversing
changes made to 26cf6e4.
  • Loading branch information
cjy37 committed Jul 27, 2018
1 parent 7e776b8 commit b3ed833
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/ios/CDVInAppBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
@class CDVInAppBrowserViewController;

@interface CDVInAppBrowser : CDVPlugin {
UIWindow * tmpWindow;
}

@property (nonatomic, retain) CDVInAppBrowserViewController* inAppBrowserViewController;
Expand Down
18 changes: 5 additions & 13 deletions src/ios/CDVInAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,8 @@ - (void)show:(CDVInvokedUrlCommand*)command
// Run later to avoid the "took a long time" log message.
dispatch_async(dispatch_get_main_queue(), ^{
if (weakSelf.inAppBrowserViewController != nil) {
if (!tmpWindow) {
CGRect frame = [[UIScreen mainScreen] bounds];
tmpWindow = [[UIWindow alloc] initWithFrame:frame];
}
CGRect frame = [[UIScreen mainScreen] bounds];
UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:frame];
UIViewController *tmpController = [[UIViewController alloc] init];
[tmpWindow setRootViewController:tmpController];
[tmpWindow setWindowLevel:UIWindowLevelNormal];
Expand Down Expand Up @@ -272,9 +270,7 @@ - (void)hide:(CDVInvokedUrlCommand*)command
dispatch_async(dispatch_get_main_queue(), ^{
if (self.inAppBrowserViewController != nil) {
_previousStatusBarStyle = -1;
[self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{
[[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
}];
[self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}
});
}
Expand Down Expand Up @@ -839,13 +835,9 @@ - (void)close
// Run later to avoid the "took a long time" log message.
dispatch_async(dispatch_get_main_queue(), ^{
if ([weakSelf respondsToSelector:@selector(presentingViewController)]) {
[[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:^{
[[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
}];
[[weakSelf presentingViewController] dismissViewControllerAnimated:YES completion:nil];
} else {
[[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:^{
[[[[UIApplication sharedApplication] delegate] window] makeKeyAndVisible];
}];
[[weakSelf parentViewController] dismissViewControllerAnimated:YES completion:nil];
}
});
}
Expand Down

0 comments on commit b3ed833

Please sign in to comment.