mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +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:
parent
8e0d936f72
commit
3277e78732
1 changed files with 12 additions and 6 deletions
|
@ -347,6 +347,17 @@ final class PHUITimelineEventView extends AphrontView {
|
||||||
$group_children = array();
|
$group_children = array();
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
if ($event->shouldRenderEventTitle()) {
|
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(
|
$group_titles[] = $event->renderEventTitle(
|
||||||
$force_icon,
|
$force_icon,
|
||||||
$has_menu,
|
$has_menu,
|
||||||
|
@ -533,12 +544,7 @@ final class PHUITimelineEventView extends AphrontView {
|
||||||
Javelin::initBehavior('phabricator-watch-anchor');
|
Javelin::initBehavior('phabricator-watch-anchor');
|
||||||
Javelin::initBehavior('phabricator-tooltips');
|
Javelin::initBehavior('phabricator-tooltips');
|
||||||
|
|
||||||
$anchor = id(new PhabricatorAnchorView())
|
|
||||||
->setAnchorName($this->anchor)
|
|
||||||
->render();
|
|
||||||
|
|
||||||
$date = array(
|
$date = array(
|
||||||
$anchor,
|
|
||||||
javelin_tag(
|
javelin_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
|
@ -546,7 +552,7 @@ final class PHUITimelineEventView extends AphrontView {
|
||||||
'sigil' => 'has-tooltip',
|
'sigil' => 'has-tooltip',
|
||||||
'meta' => array(
|
'meta' => array(
|
||||||
'tip' => $content_source,
|
'tip' => $content_source,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
$date),
|
$date),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue