1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 20:10:55 +01:00

Adds a setLabel function to ActionView

Summary: I copied some JavaScript. I think I did OK. Though, I couldn't stop icons from writing HTML as undefined. Anyways, this give us more options, like labels, when drawing ActionViews. I'll update the UI in other places like Policy too.

Test Plan:
Built and tested on the search ui dropdown.

{F379678}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12522
This commit is contained in:
Chad Little 2015-04-23 07:03:03 -07:00
parent 72e1a25507
commit 91714568f5
5 changed files with 65 additions and 24 deletions

View file

@ -7,8 +7,8 @@
*/
return array(
'names' => array(
'core.pkg.css' => 'c424594f',
'core.pkg.js' => 'd3f3a35c',
'core.pkg.css' => '9a9b59ca',
'core.pkg.js' => '80671b76',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '3500921f',
'differential.pkg.js' => 'c0506961',
@ -124,7 +124,7 @@ return array(
'rsrc/css/phui/calendar/phui-calendar-month.css' => 'a92e47d2',
'rsrc/css/phui/calendar/phui-calendar.css' => '8675968e',
'rsrc/css/phui/phui-action-header-view.css' => '89c497e7',
'rsrc/css/phui/phui-action-list.css' => '7d727ba0',
'rsrc/css/phui/phui-action-list.css' => '4f4d09f2',
'rsrc/css/phui/phui-action-panel.css' => '3ee9afd5',
'rsrc/css/phui/phui-box.css' => '7b3a2eed',
'rsrc/css/phui/phui-button.css' => 'f780e520',
@ -486,7 +486,7 @@ return array(
'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e',
'rsrc/js/core/behavior-reveal-content.js' => '60821bc7',
'rsrc/js/core/behavior-scrollbar.js' => '834a1173',
'rsrc/js/core/behavior-search-typeahead.js' => 'bc965352',
'rsrc/js/core/behavior-search-typeahead.js' => 'c5172d25',
'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6',
'rsrc/js/core/behavior-toggle-class.js' => 'e566f52c',
'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884',
@ -497,7 +497,7 @@ return array(
'rsrc/js/phui/behavior-phui-object-box-tabs.js' => '2bfa2836',
'rsrc/js/phui/behavior-phui-timeline-dropdown-menu.js' => '4d94d9c3',
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
'rsrc/js/phuix/PHUIXActionView.js' => '6e8cefa4',
'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262',
'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca',
),
'symbols' => array(
@ -628,7 +628,7 @@ return array(
'javelin-behavior-phabricator-oncopy' => '2926fff2',
'javelin-behavior-phabricator-remarkup-assist' => 'e32d14ab',
'javelin-behavior-phabricator-reveal-content' => '60821bc7',
'javelin-behavior-phabricator-search-typeahead' => 'bc965352',
'javelin-behavior-phabricator-search-typeahead' => 'c5172d25',
'javelin-behavior-phabricator-show-older-transactions' => 'dbbf48b6',
'javelin-behavior-phabricator-tooltips' => '3ee3408b',
'javelin-behavior-phabricator-transaction-comment-form' => '9f7309fb',
@ -718,7 +718,7 @@ return array(
'paste-css' => 'eb997ddd',
'path-typeahead' => 'f7fc67ec',
'people-profile-css' => '25970776',
'phabricator-action-list-view-css' => '7d727ba0',
'phabricator-action-list-view-css' => '4f4d09f2',
'phabricator-application-launch-view-css' => '16ca323f',
'phabricator-busy' => '59a7976a',
'phabricator-chatlog-css' => '852140ff',
@ -812,7 +812,7 @@ return array(
'phui-workboard-view-css' => '3279cbbf',
'phui-workpanel-view-css' => 'e495a5cc',
'phuix-action-list-view' => 'b5c256b8',
'phuix-action-view' => '6e8cefa4',
'phuix-action-view' => '8cf6d262',
'phuix-dropdown-menu' => 'bd4c8dca',
'policy-css' => '957ea14c',
'policy-edit-css' => '815c66f7',
@ -1334,11 +1334,6 @@ return array(
'phabricator-drag-and-drop-file-upload',
'phabricator-textareautils',
),
'6e8cefa4' => array(
'javelin-install',
'javelin-dom',
'javelin-util',
),
'6eff08aa' => array(
'javelin-install',
'javelin-util',
@ -1512,6 +1507,11 @@ return array(
'javelin-stratcom',
'javelin-behavior',
),
'8cf6d262' => array(
'javelin-install',
'javelin-dom',
'javelin-util',
),
'8e1389b5' => array(
'javelin-behavior',
'javelin-stratcom',
@ -1729,16 +1729,6 @@ return array(
'javelin-mask',
'phabricator-drag-and-drop-file-upload',
),
'bc965352' => array(
'javelin-behavior',
'javelin-typeahead-ondemand-source',
'javelin-typeahead',
'javelin-dom',
'javelin-uri',
'javelin-util',
'javelin-stratcom',
'phabricator-prefab',
),
'bd4c8dca' => array(
'javelin-install',
'javelin-util',
@ -1765,6 +1755,16 @@ return array(
'javelin-dom',
'javelin-vector',
),
'c5172d25' => array(
'javelin-behavior',
'javelin-typeahead-ondemand-source',
'javelin-typeahead',
'javelin-dom',
'javelin-uri',
'javelin-util',
'javelin-stratcom',
'phabricator-prefab',
),
'c51ae228' => array(
'javelin-behavior',
'javelin-util',

View file

@ -6,6 +6,7 @@ final class PhabricatorActionView extends AphrontView {
private $icon;
private $href;
private $disabled;
private $label;
private $workflow;
private $renderAsForm;
private $download;
@ -36,6 +37,7 @@ final class PhabricatorActionView extends AphrontView {
$this->objectURI = $object_uri;
return $this;
}
public function getObjectURI() {
return $this->objectURI;
}
@ -85,6 +87,11 @@ final class PhabricatorActionView extends AphrontView {
return $this;
}
public function setLabel($label) {
$this->label = $label;
return $this;
}
public function setDisabled($disabled) {
$this->disabled = $disabled;
return $this;
@ -173,10 +180,15 @@ final class PhabricatorActionView extends AphrontView {
$classes = array();
$classes[] = 'phabricator-action-view';
if ($this->disabled) {
$classes[] = 'phabricator-action-view-disabled';
}
if ($this->label) {
$classes[] = 'phabricator-action-view-label';
}
if ($this->selected) {
$classes[] = 'phabricator-action-view-selected';
}

View file

@ -73,6 +73,25 @@
color: {$darkgreytext};
}
.phabricator-action-view-label .phabricator-action-view-item {
font-size: 13px;
font-weight: bold;
color: {$bluetext};
padding: 4px 8px 6px 8px;
display: block;
-webkit-font-smoothing: antialiased;
}
.device-desktop li.phabricator-action-view-label:hover
.phabricator-action-view-item {
background-color: #fff;
color: {$bluetext};
}
.phabricator-action-view + .phabricator-action-view-label {
padding-top: 8px;
}
.phabricator-action-view-icon {
width: 14px;
height: 14px;

View file

@ -212,7 +212,7 @@ JX.behavior('phabricator-search-typeahead', function(config) {
item.setHref(spec.href);
item.setHandler(function() { menu.close(); });
} else {
item.setDisabled(true);
item.setLabel(true);
}
list.addItem(item);

View file

@ -13,6 +13,7 @@ JX.install('PHUIXActionView', {
_name: null,
_icon: 'none',
_disabled: false,
_label: false,
_handler: null,
_selected: false,
@ -31,6 +32,15 @@ JX.install('PHUIXActionView', {
return this;
},
setLabel: function(label) {
this._label = label;
JX.DOM.alterClass(
this.getNode(),
'phabricator-action-view-label',
label);
return this;
},
setSelected: function(selected) {
this._selected = selected;
JX.DOM.alterClass(