incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: Re-fix CB-502, Fixed CB-302 - orientation change event fired off twice on iOS 5.x
Date Fri, 13 Apr 2012 19:50:57 GMT
Updated Branches:
  refs/heads/master 7588deb79 -> 844be9802


Re-fix CB-502, Fixed CB-302 - orientation change event fired off twice on iOS 5.x


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/844be980
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/844be980
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/844be980

Branch: refs/heads/master
Commit: 844be980248ca980f10f19a1524fe16f86e8170e
Parents: 7588deb
Author: Shazron Abdullah <shazron@apache.org>
Authored: Fri Apr 13 12:49:54 2012 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Fri Apr 13 12:50:44 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/844be980/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 95b9066..55f4304 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -303,9 +303,14 @@
 			i = 90;
 			break;
 	}
-	// TODO: update JS references here
-	NSString* jsCallback = [NSString stringWithFormat:@"window.__defineGetter__('orientation',function(){
return %d; }); cordova.fireEvent('orientationchange', window);",i];
-	[self.webView stringByEvaluatingJavaScriptFromString:jsCallback];    
+    
+    if (!IsAtLeastiOSVersion(@"5.0")) {
+        NSString* jsCallback = [NSString stringWithFormat:
+                                @"window.__defineGetter__('orientation',function(){ return
%d; }); \
+                                  cordova.fireWindowEvent('orientationchange');"
+                                , i];
+        [self.webView stringByEvaluatingJavaScriptFromString:jsCallback];    
+    }
 }
 
 - (void) createGapView


Mime
View raw message