1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-14 00:31:05 +01:00

Put inline comment anchors above the comments

Summary: See T955. We jump to an awkard place right now; jump above the comment instead.

Test Plan: Clicked inline comment anchor links.

Reviewers: Makinde, btrahan

Reviewed By: Makinde

CC: aran, epriestley

Maniphest Tasks: T955

Differential Revision: https://secure.phabricator.com/D2029
This commit is contained in:
epriestley 2012-03-26 21:57:51 -07:00
parent 914f044b62
commit 43f0076615
3 changed files with 32 additions and 17 deletions

View file

@ -172,7 +172,7 @@ celerity_register_resource_map(array(
),
'differential-changeset-view-css' =>
array(
'uri' => '/res/de3d6ec7/rsrc/css/application/differential/changeset-view.css',
'uri' => '/res/13983f98/rsrc/css/application/differential/changeset-view.css',
'type' => 'css',
'requires' =>
array(
@ -2030,7 +2030,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/21d01ed8/core.pkg.js',
'type' => 'js',
),
'551249fc' =>
'8a5929ca' =>
array(
'name' => 'differential.pkg.css',
'symbols' =>
@ -2048,7 +2048,7 @@ celerity_register_resource_map(array(
10 => 'phabricator-content-source-view-css',
11 => 'differential-local-commits-view-css',
),
'uri' => '/res/pkg/551249fc/differential.pkg.css',
'uri' => '/res/pkg/8a5929ca/differential.pkg.css',
'type' => 'css',
),
'9b256876' =>
@ -2155,7 +2155,7 @@ celerity_register_resource_map(array(
'aphront-crumbs-view-css' => '82263727',
'aphront-dialog-view-css' => '82263727',
'aphront-form-view-css' => '82263727',
'aphront-headsup-action-list-view-css' => '551249fc',
'aphront-headsup-action-list-view-css' => '8a5929ca',
'aphront-list-filter-view-css' => '82263727',
'aphront-pager-view-css' => '82263727',
'aphront-panel-view-css' => '82263727',
@ -2163,16 +2163,16 @@ celerity_register_resource_map(array(
'aphront-table-view-css' => '82263727',
'aphront-tokenizer-control-css' => '82263727',
'aphront-typeahead-control-css' => '82263727',
'differential-changeset-view-css' => '551249fc',
'differential-core-view-css' => '551249fc',
'differential-changeset-view-css' => '8a5929ca',
'differential-core-view-css' => '8a5929ca',
'differential-inline-comment-editor' => '9b256876',
'differential-local-commits-view-css' => '551249fc',
'differential-revision-add-comment-css' => '551249fc',
'differential-revision-comment-css' => '551249fc',
'differential-revision-comment-list-css' => '551249fc',
'differential-revision-detail-css' => '551249fc',
'differential-revision-history-css' => '551249fc',
'differential-table-of-contents-css' => '551249fc',
'differential-local-commits-view-css' => '8a5929ca',
'differential-revision-add-comment-css' => '8a5929ca',
'differential-revision-comment-css' => '8a5929ca',
'differential-revision-comment-list-css' => '8a5929ca',
'differential-revision-detail-css' => '8a5929ca',
'differential-revision-history-css' => '8a5929ca',
'differential-table-of-contents-css' => '8a5929ca',
'diffusion-commit-view-css' => '61f9d480',
'javelin-behavior' => '4fbae2af',
'javelin-behavior-aphront-basic-tokenizer' => '2af849fb',
@ -2221,7 +2221,7 @@ celerity_register_resource_map(array(
'maniphest-task-summary-css' => '31583232',
'maniphest-transaction-detail-css' => '31583232',
'phabricator-app-buttons-css' => '82263727',
'phabricator-content-source-view-css' => '551249fc',
'phabricator-content-source-view-css' => '8a5929ca',
'phabricator-core-buttons-css' => '82263727',
'phabricator-core-css' => '82263727',
'phabricator-directory-css' => '82263727',
@ -2231,7 +2231,7 @@ celerity_register_resource_map(array(
'phabricator-keyboard-shortcut' => '21d01ed8',
'phabricator-keyboard-shortcut-manager' => '21d01ed8',
'phabricator-menu-item' => '21d01ed8',
'phabricator-object-selector-css' => '551249fc',
'phabricator-object-selector-css' => '8a5929ca',
'phabricator-paste-file-upload' => '21d01ed8',
'phabricator-remarkup-css' => '82263727',
'phabricator-shaped-request' => '9b256876',

View file

@ -183,8 +183,9 @@ final class DifferentialInlineCommentView extends AphrontView {
$anchor = phutil_render_tag(
'a',
array(
'name' => $anchor_name,
'id' => $anchor_name,
'name' => $anchor_name,
'id' => $anchor_name,
'class' => 'differential-inline-comment-anchor',
),
'');

View file

@ -347,3 +347,17 @@ tr.differential-inline-hidden {
tr.differential-inline-loading {
opacity: 0.5;
}
/* In the document, the anchor is positioned inside the inline comment, but
this makes the browser jump into the comment so the top isn't visible.
Instead, artificially position it a bit above the comment so we'll jump a
bit before the comment. This allows us to see the entire comment (and
generally the commented-on lines, at least in the case of one or two-line
comments) after the jump.
*/
.differential-inline-comment-anchor {
position: absolute;
display: block;
margin-top: -72px;
}