incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: Fixes CB-751 - Undefined function is called when orientation change
Date Fri, 11 May 2012 23:00:09 GMT
Updated Branches:
  refs/heads/master 0a4dbf0ff -> 134d14eaf


Fixes CB-751 - Undefined function is called when orientation change


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/134d14ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/134d14ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/134d14ea

Branch: refs/heads/master
Commit: 134d14eaff2832d491f047303a5bf9733d2be1fb
Parents: 0a4dbf0
Author: Shazron Abdullah <shazron@apache.org>
Authored: Fri May 11 15:59:48 2012 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Fri May 11 16:00:02 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/134d14ea/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 7abe82c..f3114ce 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -262,7 +262,13 @@
 			break;
 	}
 	
-	NSString* jsCall = [ NSString stringWithFormat:@"shouldRotateToOrientation(%d);",i];
+	NSString* jsCall = [NSString stringWithFormat:
+                        @"(function(){ \
+                                if('shouldRotateToOrientation' in window) { \
+                                    return window.shouldRotateToOrientation(%d); \
+                                } \
+                            })()"
+                        , i];
 	NSString* res = [webView stringByEvaluatingJavaScriptFromString:jsCall];
 	
 	if([res length] > 0)


Mime
View raw message