Skip to content

Commit

Permalink
Bug fix: cordova is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
wf9a5m75 committed Jul 20, 2017
1 parent f64ceef commit b3ea3ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/android/plugin/google/maps/MyPluginLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public FrontLayerLayout(Context context) {
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
if (isSuspended || pluginMaps == null || pluginMaps.size() == 0) {
webView.loadUrl("javascript:(cordova && cordova.fireDocumentEvent('plugin_touch', {}));");
webView.loadUrl("javascript:if(cordova){cordova.fireDocumentEvent('plugin_touch', {});}");
return false;
}
MyPluginLayout.this.stopFlag = true;
Expand Down
2 changes: 1 addition & 1 deletion src/ios/GoogleMaps/MyPluginLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ - (void)execJS: (NSString *)jsString {
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
if (self.isSuspended || self.pluginScrollView.debugView.mapCtrls == nil || self.pluginScrollView.debugView.mapCtrls.count == 0) {
// Assumes all touches for the browser
[self execJS:@"javascript:(cordova && cordova.fireDocumentEvent('plugin_touch', {}));"];
[self execJS:@"javascript:if(cordova){cordova.fireDocumentEvent('plugin_touch', {});}"];
return [self.webView hitTest:point withEvent:event];
}

Expand Down

0 comments on commit b3ea3ce

Please sign in to comment.