Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14757613
D18114.id43584.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D18114.id43584.diff
View Options
diff --git a/src/applications/uiexample/examples/PHUIIconExample.php b/src/applications/uiexample/examples/PHUIIconExample.php
--- a/src/applications/uiexample/examples/PHUIIconExample.php
+++ b/src/applications/uiexample/examples/PHUIIconExample.php
@@ -159,7 +159,8 @@
->setIcon($icon)
->setBackground('bg-blue')
->setHref('#')
- ->addClass('mmr');
+ ->addClass('mmr')
+ ->setTooltip($icon);
}
$layout_cicons = id(new PHUIBoxView())
diff --git a/src/view/phui/PHUIIconView.php b/src/view/phui/PHUIIconView.php
--- a/src/view/phui/PHUIIconView.php
+++ b/src/view/phui/PHUIIconView.php
@@ -18,6 +18,7 @@
private $iconFont;
private $iconColor;
private $iconBackground;
+ private $tooltip;
public function setHref($href) {
$this->href = $href;
@@ -60,6 +61,11 @@
return $this;
}
+ public function setTooltip($text) {
+ $this->tooltip = $text;
+ return $this;
+ }
+
protected function getTagName() {
$tag = 'span';
if ($this->href) {
@@ -100,11 +106,24 @@
$this->appendChild($this->text);
}
+ $sigil = null;
+ $meta = array();
+ if ($this->tooltip) {
+ Javelin::initBehavior('phabricator-tooltips');
+ require_celerity_resource('aphront-tooltip-css');
+ $sigil = 'has-tooltip';
+ $meta = array(
+ 'tip' => $this->tooltip,
+ );
+ }
+
return array(
'href' => $this->href,
'style' => $style,
'aural' => false,
'class' => $classes,
+ 'sigil' => $sigil,
+ 'meta' => $meta,
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 23, 2:14 AM (56 m, 18 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7029694
Default Alt Text
D18114.id43584.diff (1 KB)
Attached To
Mode
D18114: Add a tooltip method to PHUIIconView
Attached
Detach File
Event Timeline
Log In to Comment