From ea0db5aa9d574d65ecec7701e18938597f44ecea Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 28 Jul 2017 15:11:08 -0700 Subject: [PATCH] Clean up dropdown carets Summary: Adds dropdown carets to buttons more universally that are actually dropdowns. Test Plan: Differential, Application Search, Diffusion. Mobile and Desktop. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18292 --- resources/celerity/map.php | 6 +-- ...PhabricatorApplicationSearchController.php | 2 +- src/view/phui/PHUIButtonView.php | 48 +++++++++---------- webroot/rsrc/css/phui/button/phui-button.css | 2 +- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 23e9733c10..86c6567f0e 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => 'e68cf1fa', 'conpherence.pkg.js' => 'b5b51108', - 'core.pkg.css' => 'd6046dd9', + 'core.pkg.css' => 'd9c9cfd0', 'core.pkg.js' => '5d80e0db', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '45951e9e', @@ -127,7 +127,7 @@ return array( 'rsrc/css/layout/phabricator-source-code-view.css' => 'aea41829', 'rsrc/css/phui/button/phui-button-bar.css' => 'f1ff5494', 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68', - 'rsrc/css/phui/button/phui-button.css' => '3a744520', + 'rsrc/css/phui/button/phui-button.css' => '3ca51caa', 'rsrc/css/phui/calendar/phui-calendar-day.css' => '572b1893', 'rsrc/css/phui/calendar/phui-calendar-list.css' => '576be600', 'rsrc/css/phui/calendar/phui-calendar-month.css' => '21154caf', @@ -825,7 +825,7 @@ return array( 'phui-big-info-view-css' => 'd13afcde', 'phui-box-css' => '745e881d', 'phui-button-bar-css' => 'f1ff5494', - 'phui-button-css' => '3a744520', + 'phui-button-css' => '3ca51caa', 'phui-button-simple-css' => '8e1baf68', 'phui-calendar-css' => 'f1ddf11c', 'phui-calendar-day-css' => '572b1893', diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index b0cab13e07..dbf964f9e4 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -554,7 +554,7 @@ final class PhabricatorApplicationSearchController return id(new PHUIButtonView()) ->setTag('a') ->setHref('#') - ->setText(pht('Use Results...')) + ->setText(pht('Use Results')) ->setIcon('fa-bars') ->setDropdownMenu($action_list) ->addClass('dropdown'); diff --git a/src/view/phui/PHUIButtonView.php b/src/view/phui/PHUIButtonView.php index 10ce5b5876..1aaa1cbaad 100644 --- a/src/view/phui/PHUIButtonView.php +++ b/src/view/phui/PHUIButtonView.php @@ -134,6 +134,7 @@ final class PHUIButtonView extends AphrontTagView { Javelin::initBehavior('phui-dropdown-menu'); $this->addSigil('phui-dropdown-menu'); + $this->setDropdown(true); $this->setMetadata($actions->getDropdownMenuMetadata()); return $this; @@ -223,32 +224,29 @@ final class PHUIButtonView extends AphrontTagView { protected function getTagContent() { - $icon = null; - $text = $this->text; - if ($this->icon) { - $icon = $this->icon; + $icon = $this->icon; + $text = null; + $subtext = null; - $subtext = null; - if ($this->subtext) { - $subtext = phutil_tag( - 'div', - array( - 'class' => 'phui-button-subtext', - ), - $this->subtext); - } + if ($this->subtext) { + $subtext = phutil_tag( + 'div', + array( + 'class' => 'phui-button-subtext', + ), + $this->subtext); + } - if ($this->text !== null) { - $text = phutil_tag( - 'div', - array( - 'class' => 'phui-button-text', - ), - array( - $text, - $subtext, - )); - } + if ($this->text !== null) { + $text = phutil_tag( + 'div', + array( + 'class' => 'phui-button-text', + ), + array( + $this->text, + $subtext, + )); } $caret = null; @@ -259,7 +257,7 @@ final class PHUIButtonView extends AphrontTagView { if ($this->iconFirst == true) { return array($icon, $text, $caret); } else { - return array($text, $icon); + return array($text, $icon, $caret); } } } diff --git a/webroot/rsrc/css/phui/button/phui-button.css b/webroot/rsrc/css/phui/button/phui-button.css index ac3ae2176d..8cdd818f12 100644 --- a/webroot/rsrc/css/phui/button/phui-button.css +++ b/webroot/rsrc/css/phui/button/phui-button.css @@ -270,7 +270,7 @@ a.policy-control .phui-button-text { } .dropdown .phui-button-text { - margin-right: 16px; + margin-right: 8px; } .button.has-icon .phui-button-text {