mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-27 16:00:59 +01:00
Fill <a href> in PhabricatorMenuItem
Summary: The <a href> attribute is useful because user knows where the link goes before opening it plus he can copy it to the clipboard plus he can add it to the bookmarks. Test Plan: Display revision. View Options. Click. Reviewers: epriestley Reviewed By: epriestley CC: aran Differential Revision: https://secure.phabricator.com/D1436
This commit is contained in:
parent
ef768f9694
commit
ae0d9770a5
3 changed files with 8 additions and 5 deletions
|
@ -472,7 +472,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-differential-dropdown-menus' =>
|
||||
array(
|
||||
'uri' => '/res/4d4bea31/rsrc/js/application/differential/behavior-dropdown-menus.js',
|
||||
'uri' => '/res/acba60ad/rsrc/js/application/differential/behavior-dropdown-menus.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -1419,7 +1419,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'phabricator-menu-item' =>
|
||||
array(
|
||||
'uri' => '/res/08d90375/rsrc/js/application/core/DropdownMenuItem.js',
|
||||
'uri' => '/res/32fc2325/rsrc/js/application/core/DropdownMenuItem.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
|
||||
JX.install('PhabricatorMenuItem', {
|
||||
|
||||
construct : function(name, action) {
|
||||
construct : function(name, action, href) {
|
||||
this.setName(name);
|
||||
this.setHref(href || '#');
|
||||
this._action = action;
|
||||
},
|
||||
|
||||
|
@ -19,7 +20,7 @@ JX.install('PhabricatorMenuItem', {
|
|||
if (this.getDisabled()) {
|
||||
return JX.$N('span', this.getName());
|
||||
} else {
|
||||
var attrs = { href : '#', meta : { item : this } };
|
||||
var attrs = { href : this.getHref(), meta : { item : this } };
|
||||
return JX.$N('a', attrs, this.getName());
|
||||
}
|
||||
},
|
||||
|
@ -31,6 +32,7 @@ JX.install('PhabricatorMenuItem', {
|
|||
|
||||
properties : {
|
||||
name : '',
|
||||
href : '',
|
||||
disabled : false
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ JX.behavior('differential-dropdown-menus', function(config) {
|
|||
function link_to(name, uri) {
|
||||
var item = new JX.PhabricatorMenuItem(
|
||||
name,
|
||||
JX.bind(null, window.open, uri));
|
||||
JX.bind(null, window.open, uri),
|
||||
uri);
|
||||
item.setDisabled(!uri);
|
||||
return item;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue