1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 17:00:59 +01:00

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
This commit is contained in:
Chad Little 2015-07-27 07:51:53 -07:00
parent bccdbacf44
commit 559bcc42c2
2 changed files with 9 additions and 0 deletions

View file

@ -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,
),
);
}

View file

@ -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);