Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13957040
D8975.id21293.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
D8975.id21293.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
return array(
'names' =>
array(
- 'core.pkg.css' => '83f73666',
+ 'core.pkg.css' => '01ff8ddd',
'core.pkg.js' => '417722ff',
'darkconsole.pkg.js' => 'ca8671ce',
'differential.pkg.css' => '8a064eb7',
@@ -115,7 +115,7 @@
'rsrc/css/font/font-source-sans-pro.css' => '91d53463',
'rsrc/css/font/phui-font-icon-base.css' => 'cd92ff25',
'rsrc/css/layout/phabricator-action-header-view.css' => 'c14dfc57',
- 'rsrc/css/layout/phabricator-action-list-view.css' => 'ae272c7e',
+ 'rsrc/css/layout/phabricator-action-list-view.css' => '6f7ef696',
'rsrc/css/layout/phabricator-crumbs-view.css' => '0222cbe0',
'rsrc/css/layout/phabricator-filetree-view.css' => 'a8c86ace',
'rsrc/css/layout/phabricator-hovercard-view.css' => '46a13cf0',
@@ -402,7 +402,7 @@
'rsrc/js/application/phortune/behavior-stripe-payment-form.js' => '1693a296',
'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'b3e5ee60',
'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef',
- 'rsrc/js/application/policy/behavior-policy-control.js' => 'c01153ea',
+ 'rsrc/js/application/policy/behavior-policy-control.js' => 'b907d648',
'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '263aeb8c',
'rsrc/js/application/ponder/behavior-votebox.js' => '327dbe61',
'rsrc/js/application/projects/behavior-project-boards.js' => 'd8e135db',
@@ -482,7 +482,7 @@
'rsrc/js/core/phtize.js' => 'd254d646',
'rsrc/js/phui/behavior-phui-object-box-tabs.js' => 'a3e2244e',
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
- 'rsrc/js/phuix/PHUIXActionView.js' => '20793977',
+ 'rsrc/js/phuix/PHUIXActionView.js' => '5d4607b5',
'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bc3bd59c',
'rsrc/swf/aphlict.swf' => 'abac967d',
),
@@ -618,7 +618,7 @@
'javelin-behavior-pholio-mock-edit' => '1e1e8bb0',
'javelin-behavior-pholio-mock-view' => '28497740',
'javelin-behavior-phui-object-box-tabs' => 'a3e2244e',
- 'javelin-behavior-policy-control' => 'c01153ea',
+ 'javelin-behavior-policy-control' => 'b907d648',
'javelin-behavior-policy-rule-editor' => '263aeb8c',
'javelin-behavior-ponder-votebox' => '327dbe61',
'javelin-behavior-project-boards' => 'd8e135db',
@@ -684,7 +684,7 @@
'path-typeahead' => 'f7fc67ec',
'people-profile-css' => 'ba7b2762',
'phabricator-action-header-view-css' => 'c14dfc57',
- 'phabricator-action-list-view-css' => 'ae272c7e',
+ 'phabricator-action-list-view-css' => '6f7ef696',
'phabricator-application-launch-view-css' => 'd290ba21',
'phabricator-busy' => '6453c869',
'phabricator-chatlog-css' => '852140ff',
@@ -776,7 +776,7 @@
'phui-workboard-view-css' => '84f2c272',
'phui-workpanel-view-css' => '97b69459',
'phuix-action-list-view' => 'b5c256b8',
- 'phuix-action-view' => '20793977',
+ 'phuix-action-view' => '5d4607b5',
'phuix-dropdown-menu' => 'bc3bd59c',
'policy-css' => '957ea14c',
'policy-edit-css' => '05cca26a',
@@ -1198,6 +1198,12 @@
0 => 'javelin-behavior',
1 => 'javelin-stratcom',
),
+ '5d4607b5' =>
+ array(
+ 0 => 'javelin-install',
+ 1 => 'javelin-dom',
+ 2 => 'javelin-util',
+ ),
'5d584426' =>
array(
0 => 'javelin-behavior',
@@ -1217,18 +1223,6 @@
2 => 'javelin-util',
3 => 'phabricator-shaped-request',
),
- '7319e029' =>
- array(
- 0 => 'javelin-behavior',
- 1 => 'javelin-dom',
- ),
- '62e18640' =>
- array(
- 0 => 'javelin-install',
- 1 => 'javelin-util',
- 2 => 'javelin-dom',
- 3 => 'javelin-typeahead-normalizer',
- ),
'6453c869' =>
array(
0 => 'javelin-install',
@@ -1257,6 +1251,18 @@
1 => 'javelin-stratcom',
2 => 'javelin-dom',
),
+ '7319e029' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-dom',
+ ),
+ '62e18640' =>
+ array(
+ 0 => 'javelin-install',
+ 1 => 'javelin-util',
+ 2 => 'javelin-dom',
+ 3 => 'javelin-typeahead-normalizer',
+ ),
'75903ee1' =>
array(
0 => 'javelin-behavior',
@@ -1608,6 +1614,16 @@
5 => 'javelin-util',
6 => 'phabricator-textareautils',
),
+ 'b907d648' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-dom',
+ 2 => 'javelin-util',
+ 3 => 'phuix-dropdown-menu',
+ 4 => 'phuix-action-list-view',
+ 5 => 'phuix-action-view',
+ 6 => 'javelin-workflow',
+ ),
'b98fc918' =>
array(
0 => 'javelin-behavior',
@@ -1655,15 +1671,6 @@
1 => 'javelin-dom',
2 => 'javelin-reactor-dom',
),
- 'c01153ea' =>
- array(
- 0 => 'javelin-behavior',
- 1 => 'javelin-dom',
- 2 => 'javelin-util',
- 3 => 'phabricator-dropdown-menu',
- 4 => 'phabricator-menu-item',
- 5 => 'javelin-workflow',
- ),
'c021950a' =>
array(
0 => 'javelin-behavior',
@@ -2007,12 +2014,6 @@
2 => 'javelin-workflow',
3 => 'javelin-dom',
),
- 20793977 =>
- array(
- 0 => 'javelin-install',
- 1 => 'javelin-dom',
- 2 => 'javelin-util',
- ),
28497740 =>
array(
0 => 'javelin-behavior',
diff --git a/webroot/rsrc/css/layout/phabricator-action-list-view.css b/webroot/rsrc/css/layout/phabricator-action-list-view.css
--- a/webroot/rsrc/css/layout/phabricator-action-list-view.css
+++ b/webroot/rsrc/css/layout/phabricator-action-list-view.css
@@ -81,6 +81,10 @@
color: {$lightgreytext};
}
+.phabricator-action-view-selected {
+ background: {$lightblue};
+}
+
.phabricator-action-view button[disabled] {
opacity: 1.0;
}
diff --git a/webroot/rsrc/js/application/policy/behavior-policy-control.js b/webroot/rsrc/js/application/policy/behavior-policy-control.js
--- a/webroot/rsrc/js/application/policy/behavior-policy-control.js
+++ b/webroot/rsrc/js/application/policy/behavior-policy-control.js
@@ -3,8 +3,9 @@
* @requires javelin-behavior
* javelin-dom
* javelin-util
- * phabricator-dropdown-menu
- * phabricator-menu-item
+ * phuix-dropdown-menu
+ * phuix-action-list-view
+ * phuix-action-view
* javelin-workflow
* @javelin
*/
@@ -13,20 +14,20 @@
var input = JX.$(config.inputID);
var value = config.value;
- var menu = new JX.PhabricatorDropdownMenu(control)
- .setWidth(260);
-
- menu.toggleAlignDropdownRight(false);
+ var menu = new JX.PHUIXDropdownMenu(control)
+ .setWidth(260)
+ .setAlign('left');
menu.listen('open', function() {
- menu.clear();
+ var list = new JX.PHUIXActionListView();
for (var ii = 0; ii < config.groups.length; ii++) {
var group = config.groups[ii];
- var header = new JX.PhabricatorMenuItem(config.labels[group], JX.bag);
- header.setDisabled(true);
- menu.addItem(header);
+ list.addItem(
+ new JX.PHUIXActionView()
+ .setName(config.labels[group])
+ .setDisabled(true));
for (var jj = 0; jj < config.order[group].length; jj++) {
var phid = config.order[group][jj];
@@ -52,18 +53,25 @@
onselect = JX.bind(null, select_policy, phid);
}
- var item = new JX.PhabricatorMenuItem(
- render_option(phid, true),
- onselect);
+ var option = config.options[phid];
+ var item = new JX.PHUIXActionView()
+ .setName(option.name)
+ .setIcon(config.icons[option.icon])
+ .setHandler(JX.bind(null, function(fn, e) {
+ e.prevent();
+ menu.close();
+ fn();
+ }, onselect));
if (phid == value) {
item.setSelected(true);
}
- menu.addItem(item);
+ list.addItem(item);
}
}
+ menu.setContent(list.getNode());
});
diff --git a/webroot/rsrc/js/phuix/PHUIXActionView.js b/webroot/rsrc/js/phuix/PHUIXActionView.js
--- a/webroot/rsrc/js/phuix/PHUIXActionView.js
+++ b/webroot/rsrc/js/phuix/PHUIXActionView.js
@@ -14,6 +14,7 @@
_icon: 'none',
_disabled: false,
_handler: null,
+ _selected: false,
_iconNode: null,
_nameNode: null,
@@ -30,8 +31,14 @@
return this;
},
- getDisabled: function() {
- return this._disabled;
+ setSelected: function(selected) {
+ this._selected = selected;
+ JX.DOM.alterClass(
+ this.getNode(),
+ 'phabricator-action-view-selected',
+ selected);
+
+ return this;
},
setName: function(name) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 15, 8:06 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712029
Default Alt Text
D8975.id21293.diff (8 KB)
Attached To
Mode
D8975: Use ActionList-based dropdowns in Policy
Attached
Detach File
Event Timeline
Log In to Comment