@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Expand comments on page load only when the anchor points into them

Summary:
Ref T3099. Currently, we expand comments in Differential when //any// anchor is present. This creates a scrolling issue described in T3099. Instead, expand them only when the anchor contains `comment`.

We can go further here, but this should fix the immediate issue.

Test Plan: Viewed `/D22`, `/D22#toc`, and `/D22#comment-3`. The first two did not expand comments; the last one did.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3099

Differential Revision: https://secure.phabricator.com/D5836

+7 -3
+1 -1
src/__celerity_resource_map__.php
··· 1513 1513 ), 1514 1514 'javelin-behavior-differential-show-all-comments' => 1515 1515 array( 1516 - 'uri' => '/res/eaa12efc/rsrc/js/application/differential/behavior-show-all-comments.js', 1516 + 'uri' => '/res/5a26be1a/rsrc/js/application/differential/behavior-show-all-comments.js', 1517 1517 'type' => 'js', 1518 1518 'requires' => 1519 1519 array(
+6 -2
webroot/rsrc/js/application/differential/behavior-show-all-comments.js
··· 27 27 // there's an anchor in the URL, since we don't want to link to "#comment-3" 28 28 // and have it collapsed. 29 29 30 - if (window.location.hash) { 30 + function at_comment_hash() { 31 + return window.location.hash && window.location.hash.match(/comment/); 32 + } 33 + 34 + if (at_comment_hash()) { 31 35 reveal(); 32 36 } else { 33 37 JX.Stratcom.listen( 34 38 'hashchange', 35 39 null, 36 40 function(e) { 37 - if (window.location.hash.match(/comment/) && reveal()) { 41 + if (at_comment_hash() && reveal()) { 38 42 try { 39 43 var target = JX.$(window.location.hash.replace(/^#/, '')); 40 44 window.scrollTo(0, target.offsetTop);