1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Move timeline anchor targets up to evade a Chrome 55 behavioral change

Summary: Fixes T11997. This lifts the targets out of the containing `overflow: hidden;` div so Chrome is willing to target them.

Test Plan: In Chrome, visited direct comment links and ended up in the right place. Clicked comment anchors, saw browser jump around again.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11997

Differential Revision: https://secure.phabricator.com/D17033
This commit is contained in:
epriestley 2016-12-12 10:33:23 -08:00
parent 8e0d936f72
commit 3277e78732

View file

@ -347,6 +347,17 @@ final class PHUITimelineEventView extends AphrontView {
$group_children = array();
foreach ($events as $event) {
if ($event->shouldRenderEventTitle()) {
// Render the group anchor here, outside the title box. If we render
// it inside the title box it ends up completely hidden and Chrome 55
// refuses to jump to it. See T11997 for discussion.
if ($extra && $this->anchor) {
$group_titles[] = id(new PhabricatorAnchorView())
->setAnchorName($this->anchor)
->render();
}
$group_titles[] = $event->renderEventTitle(
$force_icon,
$has_menu,
@ -533,12 +544,7 @@ final class PHUITimelineEventView extends AphrontView {
Javelin::initBehavior('phabricator-watch-anchor');
Javelin::initBehavior('phabricator-tooltips');
$anchor = id(new PhabricatorAnchorView())
->setAnchorName($this->anchor)
->render();
$date = array(
$anchor,
javelin_tag(
'a',
array(
@ -546,7 +552,7 @@ final class PHUITimelineEventView extends AphrontView {
'sigil' => 'has-tooltip',
'meta' => array(
'tip' => $content_source,
),
),
),
$date),
);