iOS: fixed #960 (returning on iPad reloads story)

A bit tricksy to track down, but videos keep playing and the scroll
position is preserved (on rotation while in the app, too).
This commit is contained in:
David Sinclair 2016-11-01 15:10:56 -07:00
parent 09cab80fa8
commit fff85beb23
3 changed files with 9 additions and 2 deletions

View file

@ -2176,6 +2176,11 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
}
- (void)changeWebViewWidth {
// Don't do this in the background, to avoid scrolling to the top unnecessarily
if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
return;
}
// [webView setNeedsLayout];
// [webView layoutIfNeeded];

View file

@ -368,7 +368,9 @@
// NSLog(@"---> Story page control did re-orient: %@ / %@", NSStringFromCGSize(self.view.bounds.size), NSStringFromCGSize(size));
[self.view setNeedsLayout];
[self.view layoutIfNeeded];
[self refreshPages];
// This causes the story to reload on rotation (or when going to the background), but doesn't seem necessary?
// [self refreshPages];
}];
}

View file

@ -2431,7 +2431,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = NewsBlur;
TargetAttributes = {
1D6058900D05DD3D006BFB54 = {