You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/04/21 02:44:38 UTC
ios commit: CB-8047 - [WKWebView][iOS8] wkwebview / local webserver
plugin orientation issue
Repository: cordova-ios
Updated Branches:
refs/heads/4.0.x 183e3b8a2 -> e38875dc8
CB-8047 - [WKWebView][iOS8] wkwebview / local webserver plugin orientation issue
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/e38875dc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/e38875dc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/e38875dc
Branch: refs/heads/4.0.x
Commit: e38875dc84245ce49e851cf24468f58f3b4ca185
Parents: 183e3b8
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Apr 20 17:44:37 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Apr 20 17:44:37 2015 -0700
----------------------------------------------------------------------
CordovaLib/Classes/Public/CDVViewController.m | 26 ++++------------------
1 file changed, 4 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/e38875dc/CordovaLib/Classes/Public/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVViewController.m b/CordovaLib/Classes/Public/CDVViewController.m
index d75df96..87d2fa6 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -386,24 +386,6 @@
}
}
-- (void)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation completionHandler:(void (^)(BOOL))completionHandler
-{
- // First, ask the webview via JS if it supports the new orientation
- NSString* jsCall = [NSString stringWithFormat:
- @"window.shouldRotateToOrientation && window.shouldRotateToOrientation(%ld);"
- , (long)[self mapIosOrientationToJsOrientation:interfaceOrientation]];
- __weak CDVViewController* weakSelf = self;
-
- [_webViewEngine evaluateJavaScript:jsCall completionHandler:^(NSString* obj, NSError* error) {
- if ([obj length] > 0) {
- completionHandler([obj boolValue]);
- } else {
- // if js did not handle the new orientation (no return value), use values from the plist (via supportedOrientations)
- completionHandler([weakSelf supportsOrientation:interfaceOrientation]);
- }
- }];
-}
-
- (BOOL)shouldAutorotate
{
return YES;
@@ -413,16 +395,16 @@
{
NSUInteger ret = 0;
- if ([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationPortrait]) {
+ if ([self supportsOrientation:UIInterfaceOrientationPortrait]) {
ret = ret | (1 << UIInterfaceOrientationPortrait);
}
- if ([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationPortraitUpsideDown]) {
+ if ([self supportsOrientation:UIInterfaceOrientationPortraitUpsideDown]) {
ret = ret | (1 << UIInterfaceOrientationPortraitUpsideDown);
}
- if ([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight]) {
+ if ([self supportsOrientation:UIInterfaceOrientationLandscapeRight]) {
ret = ret | (1 << UIInterfaceOrientationLandscapeRight);
}
- if ([self shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft]) {
+ if ([self supportsOrientation:UIInterfaceOrientationLandscapeLeft]) {
ret = ret | (1 << UIInterfaceOrientationLandscapeLeft);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org