From 6dc721009d9e91a46bec34b23b804ca1ff33a1bf Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 7 Sep 2018 12:18:39 -0700 Subject: [PATCH] Layout Phriction actions without floats, to avoid conflicts with floating content Summary: Ref T13195. If a Phriction page begins with a code block, the `clear: both;` currently makes it clear the action list. Instead, use table-cell layout on desktops. Test Plan: Viewed a Phriction page with an initial code block on desktop/tablet/mobile/printable layouts. Now got more sensible layouts in all cases. Reviewers: amckinley Reviewed By: amckinley Subscribers: GoogleLegacy Maniphest Tasks: T13195 Differential Revision: https://secure.phabricator.com/D19649 --- resources/celerity/map.php | 4 ++-- src/view/phui/PHUIDocumentView.php | 18 ++++++++++++++---- webroot/rsrc/css/phui/phui-document-pro.css | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 743abd38ee..d3a9a1a34f 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -146,7 +146,7 @@ return array( 'rsrc/css/phui/phui-comment-panel.css' => 'f50152ad', 'rsrc/css/phui/phui-crumbs-view.css' => '10728aaa', 'rsrc/css/phui/phui-curtain-view.css' => '2bdaf026', - 'rsrc/css/phui/phui-document-pro.css' => '0e41dd91', + 'rsrc/css/phui/phui-document-pro.css' => '1a08ef4b', 'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf', 'rsrc/css/phui/phui-document.css' => 'c4ac41f9', 'rsrc/css/phui/phui-feed-story.css' => '44a9c8e9', @@ -814,7 +814,7 @@ return array( 'phui-curtain-view-css' => '2bdaf026', 'phui-document-summary-view-css' => '9ca48bdf', 'phui-document-view-css' => 'c4ac41f9', - 'phui-document-view-pro-css' => '0e41dd91', + 'phui-document-view-pro-css' => '1a08ef4b', 'phui-feed-story-css' => '44a9c8e9', 'phui-font-icon-base-css' => '870a7360', 'phui-fontkit-css' => '1320ed01', diff --git a/src/view/phui/PHUIDocumentView.php b/src/view/phui/PHUIDocumentView.php index b29afb5496..f57152833e 100644 --- a/src/view/phui/PHUIDocumentView.php +++ b/src/view/phui/PHUIDocumentView.php @@ -171,10 +171,20 @@ final class PHUIDocumentView extends AphrontTagView { $table_of_contents, $this->header, $this->banner, - array( - $curtain, - $main_content, - ), + phutil_tag( + 'div', + array( + 'class' => 'phui-document-content-outer', + ), + phutil_tag( + 'div', + array( + 'class' => 'phui-document-content-inner', + ), + array( + $main_content, + $curtain, + ))), $foot_content, )); diff --git a/webroot/rsrc/css/phui/phui-document-pro.css b/webroot/rsrc/css/phui/phui-document-pro.css index 29dc3beffa..4d58d17cb1 100644 --- a/webroot/rsrc/css/phui/phui-document-pro.css +++ b/webroot/rsrc/css/phui/phui-document-pro.css @@ -4,7 +4,7 @@ .phui-document-view.phui-document-view-pro { max-width: 800px; - padding: 16px 16px 64px 16px; + padding: 16px 16px 32px 16px; margin: 0 auto; } @@ -21,15 +21,25 @@ } .device-desktop .has-curtain .phui-document-content-view { - padding-right: 332px; + display: table-cell; } .printable .phui-document-content-view { padding-right: 0; } +.device-desktop .phui-document-content-outer { + display: table; + width: 100%; + layout: fixed; +} + +.device-desktop .phui-document-content-inner { + display: table-row; +} + .device-desktop .phui-document-curtain { - float: right; + display: table-cell; width: 300px; }