Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-11198] Handle UIWebViewNavigationTypeOther correctly #3352

Merged
merged 3 commits into from
Oct 30, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions iphone/Classes/TiUIWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,7 @@ - (void)reload
if (reloadData != nil)
{
[self performSelector:reloadMethod withObject:reloadData withObject:reloadDataProperties];
//[timob-10846] On iOS 6 we have to reload the webview otherwise views seems to be misplaced.
if (![TiUtils isIOS6OrGreater]) {
return;
}
return;
}
[webview reload];
}
Expand Down Expand Up @@ -654,11 +651,13 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
if ([scheme hasPrefix:@"http"] || [scheme hasPrefix:@"app"] || [scheme hasPrefix:@"file"] || [scheme hasPrefix:@"ftp"])
{
DebugLog(@"[DEBUG] New scheme: %@",request);
if (ignoreNextRequest)
{
ignoreNextRequest = NO;
}
else
BOOL valid = !ignoreNextRequest;
if ([scheme hasPrefix:@"http"]) {
//UIWebViewNavigationTypeOther means we are either in a META redirect
//or it is a js request from within the page
valid = valid && (navigationType != UIWebViewNavigationTypeOther);
}
if (valid)
{
[self setReloadData:[newUrl absoluteString]];
[self setReloadDataProperties:nil];
Expand Down Expand Up @@ -703,7 +702,8 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView
NSDictionary *event = url == nil ? nil : [NSDictionary dictionaryWithObject:[self url] forKey:@"url"];
[self.proxy fireEvent:@"load" withObject:event];
}

[webView setNeedsDisplay];
ignoreNextRequest = NO;
TiViewProxy * ourProxy = (TiViewProxy *)[self proxy];
[ourProxy contentsWillChange];
}
Expand Down