1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 18:22:41 +01:00

Fix some Paste scroll issues

Summary:
  - If a Paste has very long lines, we show far too much text in the summary, because we wrap the lines. Instead, overflow them.
  - If a Paste has very long unbroken lines (MMMMM...), they extend past the page. Instead, add a scrollable container.

Test Plan:
{F27868}

{F27869}

{F27870}

Reviewers: btrahan, codeblock, chad

Reviewed By: codeblock

CC: aran

Differential Revision: https://secure.phabricator.com/D4211
This commit is contained in:
epriestley 2012-12-16 17:58:16 -08:00
parent 86353462cd
commit 4952891cd1
3 changed files with 24 additions and 4 deletions

View file

@ -2810,7 +2810,7 @@ celerity_register_resource_map(array(
),
'phabricator-source-code-view-css' =>
array(
'uri' => '/res/aa04c202/rsrc/css/layout/phabricator-source-code-view.css',
'uri' => '/res/87935c75/rsrc/css/layout/phabricator-source-code-view.css',
'type' => 'css',
'requires' =>
array(

View file

@ -67,11 +67,16 @@ final class PhabricatorSourceCodeView extends AphrontView {
$classes[] = 'PhabricatorMonospaced';
return phutil_render_tag(
'div',
array(
'class' => 'phabricator-source-code-container',
),
phutil_render_tag(
'table',
array(
'class' => implode(' ', $classes),
),
implode('', $rows));
implode('', $rows)));
}
}

View file

@ -2,6 +2,11 @@
* @provides phabricator-source-code-view-css
*/
.phabricator-source-code-container {
overflow-x: auto;
overflow-y: hidden;
}
.phabricator-source-code {
white-space: pre-wrap;
padding: 2px 8px 1px;
@ -28,3 +33,13 @@
.phabricator-source-code-summary {
margin-bottom: 4px;
}
/* If a Paste has enormously long lines, truncate them in the summary on the
list page. They'll be fully visible on the Paste itself. */
.phabricator-source-code-summary .phabricator-source-code-container {
overflow-x: hidden;
}
.phabricator-source-code-summary .phabricator-source-code {
white-space: nowrap;
}