phorge/webroot/rsrc/js/core/DropdownMenuItem.js
Jakub Vrana a265e10c42 Move js/application/core/ one level up
Test Plan: Pressed `?` on homepage.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5761
2013-04-23 10:56:46 -07:00

40 lines
708 B
JavaScript

/**
* @requires javelin-install
* javelin-dom
* @provides phabricator-menu-item
* @javelin
*/
JX.install('PhabricatorMenuItem', {
construct : function(name, action, href) {
this.setName(name);
this.setHref(href || '#');
this._action = action;
},
members : {
_action : null,
render : function() {
if (this.getDisabled()) {
return JX.$N('span', this.getName());
} else {
var attrs = { href : this.getHref(), meta : { item : this } };
return JX.$N('a', attrs, this.getName());
}
},
select : function() {
this._action();
}
},
properties : {
name : '',
href : '',
disabled : false
}
});