@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a tooltip method to PHUIIconView

Summary: We seem to use these a lot. Makes the code cleaner.

Test Plan: UIExamples.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18114

authored by

Chad Little and committed by
chad
2a302291 6cb326e5

+21 -1
+2 -1
src/applications/uiexample/examples/PHUIIconExample.php
··· 159 159 ->setIcon($icon) 160 160 ->setBackground('bg-blue') 161 161 ->setHref('#') 162 - ->addClass('mmr'); 162 + ->addClass('mmr') 163 + ->setTooltip($icon); 163 164 } 164 165 165 166 $layout_cicons = id(new PHUIBoxView())
+19
src/view/phui/PHUIIconView.php
··· 18 18 private $iconFont; 19 19 private $iconColor; 20 20 private $iconBackground; 21 + private $tooltip; 21 22 22 23 public function setHref($href) { 23 24 $this->href = $href; ··· 60 61 return $this; 61 62 } 62 63 64 + public function setTooltip($text) { 65 + $this->tooltip = $text; 66 + return $this; 67 + } 68 + 63 69 protected function getTagName() { 64 70 $tag = 'span'; 65 71 if ($this->href) { ··· 100 106 $this->appendChild($this->text); 101 107 } 102 108 109 + $sigil = null; 110 + $meta = array(); 111 + if ($this->tooltip) { 112 + Javelin::initBehavior('phabricator-tooltips'); 113 + require_celerity_resource('aphront-tooltip-css'); 114 + $sigil = 'has-tooltip'; 115 + $meta = array( 116 + 'tip' => $this->tooltip, 117 + ); 118 + } 119 + 103 120 return array( 104 121 'href' => $this->href, 105 122 'style' => $style, 106 123 'aural' => false, 107 124 'class' => $classes, 125 + 'sigil' => $sigil, 126 + 'meta' => $meta, 108 127 ); 109 128 } 110 129