mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Open "Help" menu links in a new window
Summary: Fixes T11243. Seems reasonable to open this stuff in a new window so you don't put any application state in Herald, etc., at risk -- looking in this menu for help with a currently-executing workflow is reasonable and normal. Test Plan: Clicked a help menu link, saw it open in a new page. Reviewers: avivey, chad Reviewed By: chad Maniphest Tasks: T11243 Differential Revision: https://secure.phabricator.com/D16230
This commit is contained in:
parent
2a1393c008
commit
c7e7f113fd
2 changed files with 16 additions and 3 deletions
|
@ -183,7 +183,8 @@ abstract class PhabricatorApplication
|
||||||
$item = id(new PHUIListItemView())
|
$item = id(new PHUIListItemView())
|
||||||
->setName($article['name'])
|
->setName($article['name'])
|
||||||
->setIcon('fa-book')
|
->setIcon('fa-book')
|
||||||
->setHref($article['href']);
|
->setHref($article['href'])
|
||||||
|
->setOpenInNewWindow(true);
|
||||||
|
|
||||||
$items[] = $item;
|
$items[] = $item;
|
||||||
}
|
}
|
||||||
|
@ -203,7 +204,8 @@ abstract class PhabricatorApplication
|
||||||
$item = id(new PHUIListItemView())
|
$item = id(new PHUIListItemView())
|
||||||
->setName($spec['name'])
|
->setName($spec['name'])
|
||||||
->setIcon('fa-envelope-o')
|
->setIcon('fa-envelope-o')
|
||||||
->setHref($href);
|
->setHref($href)
|
||||||
|
->setOpenInNewWindow(true);
|
||||||
$items[] = $item;
|
$items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,18 @@ final class PHUIListItemView extends AphrontTagView {
|
||||||
private $indented;
|
private $indented;
|
||||||
private $hideInApplicationMenu;
|
private $hideInApplicationMenu;
|
||||||
private $icons = array();
|
private $icons = array();
|
||||||
|
private $openInNewWindow = false;
|
||||||
|
|
||||||
public function setHideInApplicationMenu($hide) {
|
public function setOpenInNewWindow($open_in_new_window) {
|
||||||
|
$this->openInNewWindow = $open_in_new_window;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOpenInNewWindow() {
|
||||||
|
return $this->openInNewWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setHideInApplicationMenu($hide) {
|
||||||
$this->hideInApplicationMenu = $hide;
|
$this->hideInApplicationMenu = $hide;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -294,6 +304,7 @@ final class PHUIListItemView extends AphrontTagView {
|
||||||
'class' => implode(' ', $classes),
|
'class' => implode(' ', $classes),
|
||||||
'meta' => $meta,
|
'meta' => $meta,
|
||||||
'sigil' => $sigil,
|
'sigil' => $sigil,
|
||||||
|
'target' => $this->getOpenInNewWindow() ? '_blank' : null,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
$aural,
|
$aural,
|
||||||
|
|
Loading…
Reference in a new issue