Retry failed page anchor navigation
Summary: When the user loads a page with an anchor on it like #thing, or clicks a link to #thing, and #thing doesn't exist, keep trying to navigate to #thing for a few seconds. This allows anchors to work when the target is in content which is later ajaxed in. In particular, this affects inline comments in Differential. Test Plan: Opened inline comment links in a new tab, was in the right place when I switched tabs. Reviewers: nh, btrahan, jungejason Reviewed By: btrahan CC: aran, btrahan, epriestley Maniphest Tasks: T492 Differential Revision: https://secure.phabricator.com/D1327
This commit is contained in:
@@ -178,10 +178,13 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||
}
|
||||
}
|
||||
|
||||
$anchor_name = 'inline-'.$inline->getID();
|
||||
|
||||
$anchor = phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'name' => 'inline-'.$inline->getID(),
|
||||
'name' => $anchor_name,
|
||||
'id' => $anchor_name,
|
||||
),
|
||||
'');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user