From 2709ef7872e138e54519a8a0f552bdffd4a87b26 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Fri, 19 Sep 2014 17:25:57 -0700 Subject: [PATCH] Fixing full bleed images on landscape iphone. --- .../ios/Classes/StoryDetailViewController.m | 14 ++++++--- clients/ios/NewsBlur_Prefix.pch | 2 +- clients/ios/static/storyDetailView.css | 30 +++++++++++++++---- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/clients/ios/Classes/StoryDetailViewController.m b/clients/ios/Classes/StoryDetailViewController.m index 15a15f639..06fe3df12 100644 --- a/clients/ios/Classes/StoryDetailViewController.m +++ b/clients/ios/Classes/StoryDetailViewController.m @@ -260,8 +260,10 @@ if (UIInterfaceOrientationIsLandscape(orientation) && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { contentWidthClass = @"NB-ipad-wide"; - } else if (UIInterfaceOrientationIsLandscape(orientation) || UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + } else if (UIInterfaceOrientationIsLandscape(orientation) && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { contentWidthClass = @"NB-ipad-narrow"; + } else if (UIInterfaceOrientationIsLandscape(orientation) && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { + contentWidthClass = @"NB-iphone-wide"; } else { contentWidthClass = @"NB-iphone"; } @@ -1754,15 +1756,19 @@ shouldStartLoadWithRequest:(NSURLRequest *)request - (void)changeWebViewWidth { NSLog(@"changeWebViewWidth: %@", NSStringFromCGRect(self.view.frame)); int contentWidth = self.appDelegate.storyPageControl.view.frame.size.width; + UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; NSString *contentWidthClass; - - if (contentWidth > 740) { + + if (UIInterfaceOrientationIsLandscape(orientation) && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { contentWidthClass = @"NB-ipad-wide"; - } else if (contentWidth > 480) { + } else if (UIInterfaceOrientationIsLandscape(orientation) && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { contentWidthClass = @"NB-ipad-narrow"; + } else if (UIInterfaceOrientationIsLandscape(orientation) && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { + contentWidthClass = @"NB-iphone-wide"; } else { contentWidthClass = @"NB-iphone"; } + NSString *riverClass = (appDelegate.storiesCollection.isRiverView || appDelegate.storiesCollection.isSocialView || appDelegate.storiesCollection.isSavedView) ? diff --git a/clients/ios/NewsBlur_Prefix.pch b/clients/ios/NewsBlur_Prefix.pch index 743695d63..252e01e0e 100644 --- a/clients/ios/NewsBlur_Prefix.pch +++ b/clients/ios/NewsBlur_Prefix.pch @@ -5,7 +5,7 @@ #import #import -//#define DEBUG 1 +#define DEBUG 1 //#define PROD_DEBUG 1 #ifdef DEBUG diff --git a/clients/ios/static/storyDetailView.css b/clients/ios/static/storyDetailView.css index 608bcba53..ea43168ea 100644 --- a/clients/ios/static/storyDetailView.css +++ b/clients/ios/static/storyDetailView.css @@ -124,19 +124,26 @@ * iPad Narrow Style */ +.NB-iphone-wide .NB-header, .NB-ipad-narrow .NB-header { padding: 1em 30px; } +.NB-iphone-wide .NB-story, .NB-ipad-narrow .NB-story { padding: 25px 30px; } +.NB-iphone-wide .NB-share-inner-wrapper, .NB-ipad-narrow .NB-share-inner-wrapper { padding: 0 30px; } -.NB-ipad-narrow#story_pane .nb-story-comments-public-teaser, +.NB-iphone-wide#story_pane .nb-story-comments-public-teaser, +.NB-iphone-wide#story_pane .nb-story-comments-public-header, +.NB-iphone-wide#story_pane .nb-story-comments-friends-header, +.NB-iphone-wide#story_pane .NB-story-comments-shares-teaser, +.NB-ipad-narrow#story_pane .nb-story-comments-public-teaser, .NB-ipad-narrow#story_pane .nb-story-comments-public-header, .NB-ipad-narrow#story_pane .nb-story-comments-friends-header, .NB-ipad-narrow#story_pane .NB-story-comments-shares-teaser { @@ -144,24 +151,30 @@ padding-right: 30px; } +.NB-iphone-wide#story_pane .nb-story-comment, .NB-ipad-narrow#story_pane .nb-story-comment { padding: 0 30px 2px 90px; } +.NB-iphone-wide#story_pane .NB-story-comment .NB-user-avatar, .NB-ipad-narrow#story_pane .NB-story-comment .NB-user-avatar { left: 26px; } +.NB-iphone-wide#story_pane .nb-story-comment .nb-story-comment-reshares .nb-user-avatar, .NB-ipad-narrow#story_pane .nb-story-comment .nb-story-comment-reshares .nb-user-avatar { left: 45px; } +.NB-iphone-wide#story_pane .NB-story-comment .NB-user-avatar.NB-story-comment-reshare, .NB-ipad-narrow#story_pane .NB-story-comment .NB-user-avatar.NB-story-comment-reshare { left: 26px; } +.NB-iphone-wide#story_pane .NB-story-comment .NB-button-wrapper, .NB-ipad-narrow#story_pane .NB-story-comment .NB-button-wrapper { margin-top: -5px; } +.NB-iphone-wide .NB-button.NB-share-button a, .NB-ipad-narrow .NB-button.NB-share-button a { font-size: 14px; } @@ -481,11 +494,18 @@ div + p { height: auto !important; } +.NB-ipad-wide .NB-story img.NB-large-image { + max-width: 644px; + margin-left: -90px !important; + width: 644px !important; + height: auto !important; +} + .NB-iphone-wide .NB-story img.NB-large-image { - max-width: 100% !important; - width: auto !important; - margin-left: -12px !important; - margin-right: -12px !important; + max-width: 668px; + margin-left: -36px !important; + width: 668px !important; + height: auto !important; } .NB-story img.NB-small-image {