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

@@ -17,10 +17,15 @@ JX.install('PhabricatorMenuItem', {
_action : null,
render : function() {
var attrs = {
href: this.getHref(),
meta: { item: this },
className: this.getSelected() ? 'phabricator-menu-item-selected' : null
};
if (this.getDisabled()) {
return JX.$N('span', this.getName());
return JX.$N('span', attrs, this.getName());
} else {
var attrs = { href : this.getHref(), meta : { item : this } };
return JX.$N('a', attrs, this.getName());
}
},
@@ -31,9 +36,10 @@ JX.install('PhabricatorMenuItem', {
},
properties : {
name : '',
href : '',
disabled : false
name: '',
href: '',
disabled: false,
selected: false
}
});