Improved code a bit

This commit is contained in:
dimon4eg 2015-10-16 11:28:34 +03:00
parent ee3c000b43
commit d317cd75e1
1 changed files with 4 additions and 4 deletions

View File

@ -415,7 +415,7 @@ namespace cocos2d {
Director::getInstance()->getScheduler()->performFunctionInCocosThread([&]{
auto it = s_WebViewImpls.find(viewTag);
if (it != s_WebViewImpls.end()) {
auto webView = s_WebViewImpls[viewTag]->_webView;
auto webView = it->second->_webView;
if (webView->_onShouldStartLoading) {
allowLoad = webView->_onShouldStartLoading(webView, url);
}
@ -439,7 +439,7 @@ namespace cocos2d {
Director::getInstance()->getScheduler()->performFunctionInCocosThread([viewTag, url]{
auto it = s_WebViewImpls.find(viewTag);
if (it != s_WebViewImpls.end()) {
auto webView = s_WebViewImpls[viewTag]->_webView;
auto webView = it->second->_webView;
if (webView->_onDidFinishLoading) {
webView->_onDidFinishLoading(webView, url);
}
@ -452,7 +452,7 @@ namespace cocos2d {
Director::getInstance()->getScheduler()->performFunctionInCocosThread([viewTag, url]{
auto it = s_WebViewImpls.find(viewTag);
if (it != s_WebViewImpls.end()) {
auto webView = s_WebViewImpls[viewTag]->_webView;
auto webView = it->second->_webView;
if (webView->_onDidFailLoading) {
webView->_onDidFailLoading(webView, url);
}
@ -465,7 +465,7 @@ namespace cocos2d {
Director::getInstance()->getScheduler()->performFunctionInCocosThread([viewTag, message]{
auto it = s_WebViewImpls.find(viewTag);
if (it != s_WebViewImpls.end()) {
auto webView = s_WebViewImpls[viewTag]->_webView;
auto webView = it->second->_webView;
if (webView->_onJSCallback) {
webView->_onJSCallback(webView, message);
}