Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13965402
D8975.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
11 KB
Referenced Files
None
Subscribers
None
D8975.id.diff
View Options
diff --git a/resources/sprite/manifest/status.json b/resources/sprite/manifest/status.json
--- a/resources/sprite/manifest/status.json
+++ b/resources/sprite/manifest/status.json
@@ -263,7 +263,7 @@
},
"status-policy-admin-white" : {
"name" : "status-policy-admin-white",
- "rule" : ".status-policy-admin-white, .dropdown-menu-item:hover .status-policy-admin",
+ "rule" : ".status-policy-admin-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-admin",
"hash" : "4b16ec5170bc30fb688f7e086e61a7f1"
},
"status-policy-all" : {
@@ -273,7 +273,7 @@
},
"status-policy-all-white" : {
"name" : "status-policy-all-white",
- "rule" : ".status-policy-all-white, .dropdown-menu-item:hover .status-policy-all",
+ "rule" : ".status-policy-all-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-all",
"hash" : "24ed12bf6f58c21a82be125ace2ff0d0"
},
"status-policy-custom" : {
@@ -283,7 +283,7 @@
},
"status-policy-custom-white" : {
"name" : "status-policy-custom-white",
- "rule" : ".status-policy-custom-white, .dropdown-menu-item:hover .status-policy-custom",
+ "rule" : ".status-policy-custom-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-custom",
"hash" : "ff8b4cbe21f3b4254f343fffc170ef4b"
},
"status-policy-elist" : {
@@ -303,7 +303,7 @@
},
"status-policy-noone-white" : {
"name" : "status-policy-noone-white",
- "rule" : ".status-policy-noone-white, .dropdown-menu-item:hover .status-policy-noone",
+ "rule" : ".status-policy-noone-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-noone",
"hash" : "80fb9b153fec4d8136242c5ddc2d8e77"
},
"status-policy-project" : {
@@ -313,7 +313,7 @@
},
"status-policy-project-white" : {
"name" : "status-policy-project-white",
- "rule" : ".status-policy-project-white, .dropdown-menu-item:hover .status-policy-project",
+ "rule" : ".status-policy-project-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-project",
"hash" : "ac2b6f19edb8d6c40f0bcb3fd477a067"
},
"status-policy-public" : {
@@ -323,7 +323,7 @@
},
"status-policy-public-white" : {
"name" : "status-policy-public-white",
- "rule" : ".status-policy-public-white, .dropdown-menu-item:hover .status-policy-public",
+ "rule" : ".status-policy-public-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-public",
"hash" : "cf809ca49eefed5375c2ea081e721971"
},
"status-policy-unknown" : {
@@ -333,7 +333,7 @@
},
"status-policy-unknown-white" : {
"name" : "status-policy-unknown-white",
- "rule" : ".status-policy-unknown-white, .dropdown-menu-item:hover .status-policy-unknown",
+ "rule" : ".status-policy-unknown-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-unknown",
"hash" : "98985bfa005672c4b88feaf88cfa72bc"
},
"status-policy-user" : {
diff --git a/src/infrastructure/celerity/CeleritySpriteGenerator.php b/src/infrastructure/celerity/CeleritySpriteGenerator.php
--- a/src/infrastructure/celerity/CeleritySpriteGenerator.php
+++ b/src/infrastructure/celerity/CeleritySpriteGenerator.php
@@ -558,21 +558,16 @@
$sprites = array();
$prefix = 'status_';
+
+ $pre_rule = ', .phuix-dropdown-menu .phabricator-action-view:hover ';
$extra_css = array(
- 'policy-custom-white' =>
- ', .dropdown-menu-item:hover .status-policy-custom',
- 'policy-all-white' =>
- ', .dropdown-menu-item:hover .status-policy-all',
- 'policy-unknown-white' =>
- ', .dropdown-menu-item:hover .status-policy-unknown',
- 'policy-admin-white' =>
- ', .dropdown-menu-item:hover .status-policy-admin',
- 'policy-public-white' =>
- ', .dropdown-menu-item:hover .status-policy-public',
- 'policy-project-white' =>
- ', .dropdown-menu-item:hover .status-policy-project',
- 'policy-noone-white' =>
- ', .dropdown-menu-item:hover .status-policy-noone',
+ 'policy-custom-white' => $pre_rule.'.status-policy-custom',
+ 'policy-all-white' => $pre_rule.'.status-policy-all',
+ 'policy-unknown-white' => $pre_rule.'.status-policy-unknown',
+ 'policy-admin-white' => $pre_rule.'.status-policy-admin',
+ 'policy-public-white' => $pre_rule.'.status-policy-public',
+ 'policy-project-white' => $pre_rule.'.status-policy-project',
+ 'policy-noone-white' => $pre_rule.'.status-policy-noone',
);
foreach ($icons as $icon) {
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/css/sprite-status.css b/webroot/rsrc/css/sprite-status.css
--- a/webroot/rsrc/css/sprite-status.css
+++ b/webroot/rsrc/css/sprite-status.css
@@ -222,7 +222,7 @@
background-position: 0px -75px;
}
-.status-policy-admin-white, .dropdown-menu-item:hover .status-policy-admin {
+.status-policy-admin-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-admin {
background-position: -15px -75px;
}
@@ -230,7 +230,7 @@
background-position: -30px -75px;
}
-.status-policy-all-white, .dropdown-menu-item:hover .status-policy-all {
+.status-policy-all-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-all {
background-position: -45px -75px;
}
@@ -238,7 +238,7 @@
background-position: -60px -75px;
}
-.status-policy-custom-white, .dropdown-menu-item:hover .status-policy-custom {
+.status-policy-custom-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-custom {
background-position: -75px -75px;
}
@@ -254,7 +254,7 @@
background-position: -120px -75px;
}
-.status-policy-noone-white, .dropdown-menu-item:hover .status-policy-noone {
+.status-policy-noone-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-noone {
background-position: -135px -75px;
}
@@ -262,7 +262,7 @@
background-position: 0px -90px;
}
-.status-policy-project-white, .dropdown-menu-item:hover .status-policy-project {
+.status-policy-project-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-project {
background-position: -15px -90px;
}
@@ -270,7 +270,7 @@
background-position: -30px -90px;
}
-.status-policy-public-white, .dropdown-menu-item:hover .status-policy-public {
+.status-policy-public-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-public {
background-position: -45px -90px;
}
@@ -278,7 +278,7 @@
background-position: -60px -90px;
}
-.status-policy-unknown-white, .dropdown-menu-item:hover .status-policy-unknown {
+.status-policy-unknown-white, .phuix-dropdown-menu .phabricator-action-view:hover .status-policy-unknown {
background-position: -75px -90px;
}
diff --git a/webroot/rsrc/image/sprite-status-X2.png b/webroot/rsrc/image/sprite-status-X2.png
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
literal 0
Hc$@<O00001
diff --git a/webroot/rsrc/image/sprite-status.png b/webroot/rsrc/image/sprite-status.png
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
literal 0
Hc$@<O00001
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(option.icon, 'status')
+ .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
@@ -12,8 +12,10 @@
_node: null,
_name: null,
_icon: 'none',
+ _iconSheet: 'icons',
_disabled: false,
_handler: null,
+ _selected: false,
_iconNode: null,
_nameNode: null,
@@ -30,8 +32,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) {
@@ -46,8 +54,9 @@
return this;
},
- setIcon: function(icon) {
+ setIcon: function(icon, sheet) {
this._icon = icon;
+ this._iconSheet = sheet || this._iconSheet;
this._buildIconNode(true);
return this;
},
@@ -78,11 +87,15 @@
_buildIconNode: function(dirty) {
if (!this._iconNode || dirty) {
var attr = {
- className: 'phui-icon-view sprite-icons phabricator-action-view-icon'
+ className: [
+ 'phui-icon-view',
+ 'phabricator-action-view-icon',
+ 'sprite-' + this._iconSheet
+ ].join(' ')
};
var node = JX.$N('span', attr);
- var icon_class = 'icons-' + this._icon;
+ var icon_class = this._iconSheet + '-' + this._icon;
if (this._disabled) {
icon_class = icon_class + '-grey';
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 17, 1:49 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6720101
Default Alt Text
D8975.id.diff (11 KB)
Attached To
Mode
D8975: Use ActionList-based dropdowns in Policy
Attached
Detach File
Event Timeline
Log In to Comment