You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/01/15 20:14:35 UTC
ios commit: Fix setting of _nativeReady when cordova.js is
lazy-loaded.
Updated Branches:
refs/heads/master eb8cc9408 -> fc45dde67
Fix setting of _nativeReady when cordova.js is lazy-loaded.
https://issues.apache.org/jira/browse/CB-1978
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/fc45dde6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/fc45dde6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/fc45dde6
Branch: refs/heads/master
Commit: fc45dde676274228867949d11359165b5ab22017
Parents: eb8cc94
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Jan 15 14:14:06 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Jan 15 14:14:06 2013 -0500
----------------------------------------------------------------------
CordovaLib/Classes/CDVViewController.m | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fc45dde6/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index abdfcc7..802f2dd 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -546,7 +546,8 @@ static NSString* gOriginalUserAgent = nil;
// The .onNativeReady().fire() will work when cordova.js is already loaded.
// The _nativeReady = true; is used when this is run before cordova.js is loaded.
NSString* nativeReady = @"try{cordova.require('cordova/channel').onNativeReady.fire();}catch(e){window._nativeReady = true;}";
- [self.commandDelegate evalJs:nativeReady];
+ // Don't use [commandDelegate evalJs] here since it relies on cordova.js being loaded already.
+ [self.webView stringByEvaluatingJavaScriptFromString:nativeReady];
[self processOpenUrl];
}