From 3b5d9ff79a9b8c9a04c00f59a1517ea47431bb3c Mon Sep 17 00:00:00 2001 From: Anh Nhan Nguyen Date: Tue, 19 Mar 2013 11:16:41 -0700 Subject: [PATCH] Disappear PhabricatorObjectItemView's empty tooltips if is empty Test Plan: removed one or two labels from uiexample, verified expected behaviour Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5382 --- src/view/layout/PhabricatorObjectItemView.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/view/layout/PhabricatorObjectItemView.php b/src/view/layout/PhabricatorObjectItemView.php index 035af01b61..442b894421 100644 --- a/src/view/layout/PhabricatorObjectItemView.php +++ b/src/view/layout/PhabricatorObjectItemView.php @@ -288,16 +288,19 @@ final class PhabricatorObjectItemView extends AphrontView { private function renderHandleIcon(PhabricatorObjectHandle $handle, $label) { Javelin::initBehavior('phabricator-tooltips'); + $options = array( + 'class' => 'phabricator-object-item-handle-icon', + 'style' => 'background: url('.$handle->getImageURI().')', + ); + + if (strlen($label)) { + $options['sigil'] = 'has-tooltip'; + $options['meta'] = array('tip' => $label); + } + return javelin_tag( 'span', - array( - 'class' => 'phabricator-object-item-handle-icon', - 'sigil' => 'has-tooltip', - 'style' => 'background: url('.$handle->getImageURI().')', - 'meta' => array( - 'tip' => $label, - ), - ), + $options, ''); }