Highlight the currently selected policy in the policy dropdown control thing

Summary: Ref T603. Make this a little easier to use by highlighting the current value.

Test Plan: See screenshot.

Reviewers: chad, btrahan

Reviewed By: chad

CC: chad, aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7289
This commit is contained in:
epriestley
2013-10-12 17:08:35 -07:00
parent 5af031ec9b
commit 130a15b51b
5 changed files with 111 additions and 94 deletions

View File

@@ -10,6 +10,7 @@
JX.behavior('policy-control', function(config) {
var control = JX.$(config.controlID);
var input = JX.$(config.inputID);
var value = config.value;
var menu = new JX.PhabricatorDropdownMenu(control)
.setWidth(260);
@@ -39,8 +40,13 @@ JX.behavior('policy-control', function(config) {
JX.DOM.find(control, 'span', 'policy-label'),
render);
input.value = phid;
value = phid;
}, phid, render));
if (phid == value) {
item.setSelected(true);
}
menu.addItem(item);
}
}