Add a selected button ui state

Summary: Only for grey buttons, but can expand. Sets a selected class.

Test Plan: Review new changes in UIExamples.

Reviewers: epriestley

Reviewed By: epriestley

Spies: Korvin

Differential Revision: https://secure.phabricator.com/D18501
This commit is contained in:
Chad Little
2017-08-30 10:00:23 -07:00
parent b4cbea9018
commit 11046d495d
5 changed files with 44 additions and 9 deletions

View File

@@ -105,6 +105,19 @@ button[disabled] {
opacity: 0.5;
}
button.button-grey.selected,
a.button.button-grey.selected,
button.button-grey.selected:hover,
a.button.button-grey.selected:hover {
border-color: {$sh-orangetext};
color: {$sh-orangetext};
}
button.button-grey.selected .phui-icon-view,
a.button-grey.selected .phui-icon-view {
color: {$sh-orangetext};
}
a.phuix-dropdown-open {
color: {$greytext};
}

View File

@@ -16,6 +16,7 @@ JX.install('PHUIXButtonView', {
_iconView: null,
_color: null,
_selected: null,
_buttonType: null,
setIcon: function(icon) {
@@ -43,6 +44,13 @@ JX.install('PHUIXButtonView', {
return this;
},
setSelected: function(selected) {
var node = this.getNode();
this._selected = selected;
JX.DOM.alterClass(node, 'selected', this._selected);
return this;
},
setButtonType: function(button_type) {
var self = JX.PHUIXButtonView;