Allow setting of button colors in headers
Summary: We currently override button color for headers, since the default is blue, but if a developer sets a specific color, we should respect that. Test Plan: Set a button in the header to green and see green. See grey everywhere else. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17922
This commit is contained in:
@@ -64,6 +64,10 @@ final class PHUIButtonView extends AphrontTagView {
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getColor() {
|
||||||
|
return $this->color;
|
||||||
|
}
|
||||||
|
|
||||||
public function setDisabled($disabled) {
|
public function setDisabled($disabled) {
|
||||||
$this->disabled = $disabled;
|
$this->disabled = $disabled;
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
@@ -267,7 +267,9 @@ final class PHUIHeaderView extends AphrontTagView {
|
|||||||
if ($this->actionLinks) {
|
if ($this->actionLinks) {
|
||||||
$actions = array();
|
$actions = array();
|
||||||
foreach ($this->actionLinks as $button) {
|
foreach ($this->actionLinks as $button) {
|
||||||
$button->setColor(PHUIButtonView::GREY);
|
if (!$button->getColor()) {
|
||||||
|
$button->setColor(PHUIButtonView::GREY);
|
||||||
|
}
|
||||||
$button->addClass(PHUI::MARGIN_SMALL_LEFT);
|
$button->addClass(PHUI::MARGIN_SMALL_LEFT);
|
||||||
$button->addClass('phui-header-action-link');
|
$button->addClass('phui-header-action-link');
|
||||||
$actions[] = $button;
|
$actions[] = $button;
|
||||||
|
|||||||
Reference in New Issue
Block a user