mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 12:30:56 +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:
parent
bccdbacf44
commit
559bcc42c2
2 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,7 @@ final class PHUIBadgeMiniView extends AphrontTagView {
|
||||||
private $icon;
|
private $icon;
|
||||||
private $quality;
|
private $quality;
|
||||||
private $header;
|
private $header;
|
||||||
|
private $tipDirection;
|
||||||
|
|
||||||
public function setIcon($icon) {
|
public function setIcon($icon) {
|
||||||
$this->icon = $icon;
|
$this->icon = $icon;
|
||||||
|
@ -27,6 +28,11 @@ final class PHUIBadgeMiniView extends AphrontTagView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setTipDirection($direction) {
|
||||||
|
$this->tipDirection = $direction;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getTagName() {
|
protected function getTagName() {
|
||||||
if ($this->href) {
|
if ($this->href) {
|
||||||
return 'a';
|
return 'a';
|
||||||
|
@ -51,6 +57,8 @@ final class PHUIBadgeMiniView extends AphrontTagView {
|
||||||
'href' => $this->href,
|
'href' => $this->href,
|
||||||
'meta' => array(
|
'meta' => array(
|
||||||
'tip' => $this->header,
|
'tip' => $this->header,
|
||||||
|
'align' => $this->tipDirection,
|
||||||
|
'size' => 300,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,6 +255,7 @@ final class PHUITimelineView extends AphrontView {
|
||||||
->setIcon($badge->getIcon())
|
->setIcon($badge->getIcon())
|
||||||
->setQuality($badge->getQuality())
|
->setQuality($badge->getQuality())
|
||||||
->setHeader($badge->getName())
|
->setHeader($badge->getName())
|
||||||
|
->setTipDirection('E')
|
||||||
->setHref('/badges/view/'.$badge->getID());
|
->setHref('/badges/view/'.$badge->getID());
|
||||||
|
|
||||||
$event->addBadge($badge_view);
|
$event->addBadge($badge_view);
|
||||||
|
|
Loading…
Reference in a new issue