From 559bcc42c27a8a8ddf430bb664fd5a345317452d Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 27 Jul 2015 07:51:53 -0700 Subject: [PATCH] Add tipDirection to PHUIBadgeMiniView Summary: Makes PHUIBadgeMiniView a little easier to dictate layout. Apply in Timeline. Test Plan: Tested supercalifragilisticexpialidocious as a badge, saw it align properly. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13729 --- src/view/phui/PHUIBadgeMiniView.php | 8 ++++++++ src/view/phui/PHUITimelineView.php | 1 + 2 files changed, 9 insertions(+) diff --git a/src/view/phui/PHUIBadgeMiniView.php b/src/view/phui/PHUIBadgeMiniView.php index 5807336ca2..92d6fd8b8b 100644 --- a/src/view/phui/PHUIBadgeMiniView.php +++ b/src/view/phui/PHUIBadgeMiniView.php @@ -6,6 +6,7 @@ final class PHUIBadgeMiniView extends AphrontTagView { private $icon; private $quality; private $header; + private $tipDirection; public function setIcon($icon) { $this->icon = $icon; @@ -27,6 +28,11 @@ final class PHUIBadgeMiniView extends AphrontTagView { return $this; } + public function setTipDirection($direction) { + $this->tipDirection = $direction; + return $this; + } + protected function getTagName() { if ($this->href) { return 'a'; @@ -51,6 +57,8 @@ final class PHUIBadgeMiniView extends AphrontTagView { 'href' => $this->href, 'meta' => array( 'tip' => $this->header, + 'align' => $this->tipDirection, + 'size' => 300, ), ); } diff --git a/src/view/phui/PHUITimelineView.php b/src/view/phui/PHUITimelineView.php index 17178b8135..d8ba96c140 100644 --- a/src/view/phui/PHUITimelineView.php +++ b/src/view/phui/PHUITimelineView.php @@ -255,6 +255,7 @@ final class PHUITimelineView extends AphrontView { ->setIcon($badge->getIcon()) ->setQuality($badge->getQuality()) ->setHeader($badge->getName()) + ->setTipDirection('E') ->setHref('/badges/view/'.$badge->getID()); $event->addBadge($badge_view);