diff --git a/src/applications/differential/controller/inlinecommentpreview/DifferentialInlineCommentPreviewController.php b/src/applications/differential/controller/inlinecommentpreview/DifferentialInlineCommentPreviewController.php index b3a3e168b9..ef558dda50 100644 --- a/src/applications/differential/controller/inlinecommentpreview/DifferentialInlineCommentPreviewController.php +++ b/src/applications/differential/controller/inlinecommentpreview/DifferentialInlineCommentPreviewController.php @@ -53,6 +53,7 @@ class DifferentialInlineCommentPreviewController $view->setMarkupEngine($engine); $view->setHandles($handles); $view->setEditable(false); + $view->setPreview(true); $views[] = $view->render(); } $views = implode("\n", $views); diff --git a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php index 0a5ce04855..6678340cf9 100644 --- a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php +++ b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php @@ -24,6 +24,7 @@ final class DifferentialInlineCommentView extends AphrontView { private $handles; private $markupEngine; private $editable; + private $preview; public function setInlineComment(DifferentialInlineComment $comment) { $this->inlineComment = $comment; @@ -55,6 +56,10 @@ final class DifferentialInlineCommentView extends AphrontView { return $this; } + public function setPreview($preview) { + $this->preview = $preview; + } + public function render() { $inline = $this->inlineComment; @@ -83,34 +88,36 @@ final class DifferentialInlineCommentView extends AphrontView { $links = array(); - $links[] = javelin_render_tag( - 'a', - array( - 'href' => '#', - 'mustcapture' => true, - 'sigil' => 'differential-inline-prev', - ), - 'Previous'); + if (!$this->preview) { + $links[] = javelin_render_tag( + 'a', + array( + 'href' => '#', + 'mustcapture' => true, + 'sigil' => 'differential-inline-prev', + ), + 'Previous'); - $links[] = javelin_render_tag( - 'a', - array( - 'href' => '#', - 'mustcapture' => true, - 'sigil' => 'differential-inline-next', - ), - 'Next'); + $links[] = javelin_render_tag( + 'a', + array( + 'href' => '#', + 'mustcapture' => true, + 'sigil' => 'differential-inline-next', + ), + 'Next'); - $links[] = javelin_render_tag( - 'a', - array( - 'href' => '#', - 'mustcapture' => true, - 'sigil' => 'differential-inline-reply', - ), - 'Reply'); + $links[] = javelin_render_tag( + 'a', + array( + 'href' => '#', + 'mustcapture' => true, + 'sigil' => 'differential-inline-reply', + ), + 'Reply'); + } - if ($this->editable) { + if ($this->editable && !$this->preview) { $links[] = javelin_render_tag( 'a', array(