Diffusion browser: Update editor link when clicking on a line

Summary: Highlighing and URL are fixed on click - now the edit button too.

Test Plan: click on lines with and without value in "Editr Link" (And without %l in it).

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9227
This commit is contained in:
Aviv Eyal
2014-05-22 15:33:21 -07:00
committed by epriestley
parent 27a369d15a
commit 9bba4cda2f
3 changed files with 17 additions and 9 deletions

View File

@@ -413,6 +413,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
$callsign = $repository->getCallsign();
$editor_link = $user->loadEditorLink($path, $line, $callsign);
$template = $user->loadEditorLink($path, '%l', $callsign);
$icon_edit = id(new PHUIIconView())
->setIconFont('fa-pencil');
@@ -421,6 +422,8 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
->setText(pht('Open in Editor'))
->setHref($editor_link)
->setIcon($icon_edit)
->setID('editor_link')
->setMetadata(array('link_template' => $template))
->setDisabled(!$editor_link);
return $button;