mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Remove the application menu
Summary: Toss this completely as per discussion elsewhere. Basically it doesn't feel as useful as we imagined it would, and breadcrumbs from T1960 will replace the primary useful part (navigating up). There's some more cleanup to do but I'll hit that in the next few diffs. Closes T1828 as wontfix. Test Plan: Viewed app + local, app-without-local interfaces. Saw no app menus. Reviewers: chad Reviewed By: chad CC: aran, vrana Maniphest Tasks: T1828, T1960 Differential Revision: https://secure.phabricator.com/D4033
This commit is contained in:
parent
8a6e82eba6
commit
6482876cf3
5 changed files with 13 additions and 243 deletions
|
@ -159,13 +159,8 @@ abstract class PhabricatorController extends AphrontController {
|
|||
$view = $nav;
|
||||
}
|
||||
|
||||
if ($application) {
|
||||
$view->setCurrentApplication($application);
|
||||
}
|
||||
|
||||
$view->setUser($this->getRequest()->getUser());
|
||||
$view->setFlexNav(true);
|
||||
$view->setShowApplicationMenu(true);
|
||||
|
||||
$page->appendChild($view);
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ final class AphrontSideNavFilterView extends AphrontView {
|
|||
private $selectedFilter = false;
|
||||
private $flexNav;
|
||||
private $flexible;
|
||||
private $showApplicationMenu;
|
||||
private $user;
|
||||
private $currentApplication;
|
||||
private $active;
|
||||
|
||||
public function setActive($active) {
|
||||
|
@ -36,21 +34,11 @@ final class AphrontSideNavFilterView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setCurrentApplication(PhabricatorApplication $current) {
|
||||
$this->currentApplication = $current;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUser(PhabricatorUser $user) {
|
||||
$this->user = $user;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setShowApplicationMenu($show_application_menu) {
|
||||
$this->showApplicationMenu = $show_application_menu;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFlexNav($flex_nav) {
|
||||
$this->flexNav = $flex_nav;
|
||||
return $this;
|
||||
|
@ -144,14 +132,10 @@ final class AphrontSideNavFilterView extends AphrontView {
|
|||
$view = new AphrontSideNavView();
|
||||
$view->setFlexNav($this->flexNav);
|
||||
$view->setFlexible($this->flexible);
|
||||
$view->setShowApplicationMenu($this->showApplicationMenu);
|
||||
$view->setActive($this->active);
|
||||
if ($this->user) {
|
||||
$view->setUser($this->user);
|
||||
}
|
||||
if ($this->currentApplication) {
|
||||
$view->setCurrentApplication($this->currentApplication);
|
||||
}
|
||||
foreach ($this->items as $item) {
|
||||
list($type, $key, $name) = $item;
|
||||
switch ($type) {
|
||||
|
|
|
@ -5,9 +5,7 @@ final class AphrontSideNavView extends AphrontView {
|
|||
private $items = array();
|
||||
private $flexNav;
|
||||
private $isFlexible;
|
||||
private $showApplicationMenu;
|
||||
private $user;
|
||||
private $currentApplication;
|
||||
private $active;
|
||||
|
||||
public function setUser(PhabricatorUser $user) {
|
||||
|
@ -15,16 +13,6 @@ final class AphrontSideNavView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setShowApplicationMenu($show_application_menu) {
|
||||
$this->showApplicationMenu = $show_application_menu;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCurrentApplication(PhabricatorApplication $current) {
|
||||
$this->currentApplication = $current;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addNavItem($item) {
|
||||
$this->items[] = $item;
|
||||
return $this;
|
||||
|
@ -57,7 +45,6 @@ final class AphrontSideNavView extends AphrontView {
|
|||
$nav_classes = array();
|
||||
$nav_classes[] = 'phabricator-nav';
|
||||
|
||||
$app_id = celerity_generate_unique_node_id();
|
||||
$nav_id = null;
|
||||
$drag_id = null;
|
||||
$content_id = celerity_generate_unique_node_id();
|
||||
|
@ -65,16 +52,6 @@ final class AphrontSideNavView extends AphrontView {
|
|||
$local_menu = null;
|
||||
$main_id = celerity_generate_unique_node_id();
|
||||
|
||||
$apps = $this->renderApplications();
|
||||
|
||||
$app_menu = phutil_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phabricator-nav-col phabricator-nav-app',
|
||||
'id' => $app_id,
|
||||
),
|
||||
$apps->render());
|
||||
|
||||
if ($this->isFlexible) {
|
||||
$drag_id = celerity_generate_unique_node_id();
|
||||
$flex_bar = phutil_render_tag(
|
||||
|
@ -105,7 +82,6 @@ final class AphrontSideNavView extends AphrontView {
|
|||
'phabricator-nav',
|
||||
array(
|
||||
'mainID' => $main_id,
|
||||
'appID' => $app_id,
|
||||
'localID' => $local_id,
|
||||
'dragID' => $drag_id,
|
||||
'contentID' => $content_id,
|
||||
|
@ -127,14 +103,6 @@ final class AphrontSideNavView extends AphrontView {
|
|||
'<a href="#" class="nav-button nav-button-e nav-button-content '.
|
||||
'nav-button-selected" id="tablet-menu2"></a>'.
|
||||
'</div>'.
|
||||
'<div class="phabricator-nav-head-phone">'.
|
||||
'<a href="#" class="nav-button nav-button-w nav-button-apps" '.
|
||||
'id="phone-menu1"></button>'.
|
||||
'<a href="#" class="nav-button nav-button-menu" '.
|
||||
'id="phone-menu2"></button>'.
|
||||
'<a href="#" class="nav-button nav-button-e nav-button-content '.
|
||||
'nav-button-selected" id="phone-menu3"></button>'.
|
||||
'</div>'.
|
||||
'</div>';
|
||||
|
||||
return $header_part.phutil_render_tag(
|
||||
|
@ -143,7 +111,6 @@ final class AphrontSideNavView extends AphrontView {
|
|||
'class' => implode(' ', $nav_classes),
|
||||
'id' => $main_id,
|
||||
),
|
||||
$app_menu.
|
||||
$local_menu.
|
||||
$flex_bar.
|
||||
phutil_render_tag(
|
||||
|
@ -171,91 +138,4 @@ final class AphrontSideNavView extends AphrontView {
|
|||
}
|
||||
}
|
||||
|
||||
private function renderApplications() {
|
||||
$core = array();
|
||||
$current = $this->currentApplication;
|
||||
|
||||
$meta = null;
|
||||
|
||||
$group_core = PhabricatorApplication::GROUP_CORE;
|
||||
|
||||
$applications = PhabricatorApplication::getAllInstalledApplications();
|
||||
foreach ($applications as $application) {
|
||||
if ($application instanceof PhabricatorApplicationApplications) {
|
||||
$meta = $application;
|
||||
continue;
|
||||
}
|
||||
if ($application->getApplicationGroup() != $group_core) {
|
||||
continue;
|
||||
}
|
||||
if ($application->getApplicationOrder() !== null) {
|
||||
$core[] = $application;
|
||||
}
|
||||
}
|
||||
|
||||
$core = msort($core, 'getApplicationOrder');
|
||||
if ($meta) {
|
||||
$core[] = $meta;
|
||||
}
|
||||
$core = mpull($core, null, 'getPHID');
|
||||
|
||||
if ($current && empty($core[$current->getPHID()])) {
|
||||
array_unshift($core, $current);
|
||||
}
|
||||
|
||||
Javelin::initBehavior('phabricator-tooltips', array());
|
||||
require_celerity_resource('aphront-tooltip-css');
|
||||
|
||||
$apps = array();
|
||||
foreach ($core as $phid => $application) {
|
||||
$classes = array();
|
||||
$classes[] = 'phabricator-nav-app-item';
|
||||
|
||||
if ($current && $phid == $current->getPHID()) {
|
||||
$selected = true;
|
||||
} else {
|
||||
$selected = false;
|
||||
}
|
||||
|
||||
$iclasses = array();
|
||||
$iclasses[] = 'phabricator-nav-app-item-icon';
|
||||
$style = null;
|
||||
if ($application->getIconURI()) {
|
||||
$style = 'background-image: url('.$application->getIconURI().'); '.
|
||||
'background-size: 30px auto;';
|
||||
} else {
|
||||
$iclasses[] = 'autosprite';
|
||||
$sprite = $application->getAutospriteName();
|
||||
if ($selected) {
|
||||
$sprite .= '-selected';
|
||||
}
|
||||
$iclasses[] = 'app-'.$sprite;
|
||||
}
|
||||
|
||||
$icon = phutil_render_tag(
|
||||
'span',
|
||||
array(
|
||||
'class' => implode(' ', $iclasses),
|
||||
'style' => $style,
|
||||
),
|
||||
'');
|
||||
|
||||
$apps[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'class' => implode(' ', $classes),
|
||||
'href' => $application->getBaseURI(),
|
||||
'sigil' => 'has-tooltip',
|
||||
'meta' => array(
|
||||
'tip' => $application->getName(),
|
||||
'align' => 'E',
|
||||
),
|
||||
),
|
||||
$icon.
|
||||
phutil_escape_html($application->getName()));
|
||||
}
|
||||
|
||||
return id(new AphrontNullView())->appendChild($apps);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,13 +19,6 @@
|
|||
z-index: 3;
|
||||
}
|
||||
|
||||
.phabricator-nav-app {
|
||||
width: 149px;
|
||||
background: #262b2e;
|
||||
border-right: 1px solid #222222;
|
||||
box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.phabricator-nav-local {
|
||||
width: 179px;
|
||||
background: #ececec;
|
||||
|
@ -43,7 +36,7 @@
|
|||
.phabricator-nav-drag {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 217px;
|
||||
left: 179px;
|
||||
width: 7px;
|
||||
bottom: 0;
|
||||
z-index: 4;
|
||||
|
@ -71,28 +64,12 @@
|
|||
display: block;
|
||||
}
|
||||
|
||||
.phabricator-nav-local {
|
||||
left: 150px;
|
||||
}
|
||||
|
||||
.device-desktop .phabricator-nav-local {
|
||||
left: 38px;
|
||||
}
|
||||
|
||||
.phabricator-nav-content {
|
||||
margin-left: 150px;
|
||||
}
|
||||
|
||||
.has-local-nav .phabricator-nav-content {
|
||||
margin-left: 330px;
|
||||
}
|
||||
|
||||
.device-desktop .phabricator-nav-content {
|
||||
margin-left: 38px;
|
||||
margin-left: 180px;
|
||||
}
|
||||
|
||||
.device-desktop .has-local-nav .phabricator-nav-content {
|
||||
margin-left: 216px;
|
||||
margin-left: 178px;
|
||||
}
|
||||
|
||||
.device-desktop .local-nav-collapsed .phabricator-nav-local {
|
||||
|
@ -124,45 +101,6 @@
|
|||
background-color: #a1bbe5;
|
||||
}
|
||||
|
||||
a.phabricator-nav-app-item {
|
||||
color: #e9e9e9;
|
||||
font-weight: normal;
|
||||
padding: 4px;
|
||||
padding-left: 40px;
|
||||
vertical-align: middle;
|
||||
line-height: 30px;
|
||||
height: 30px;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/**
|
||||
* On the desktop, constrain the size of the <a /> so that the tooltip is
|
||||
* positioned correctly. Without this rule, it ends up too far to the right.
|
||||
*/
|
||||
.device-desktop a.phabricator-nav-app-item {
|
||||
padding-left: 38px;
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
span.phabricator-nav-app-item-icon {
|
||||
position: absolute;
|
||||
display: block;
|
||||
|
||||
left: 5px;
|
||||
top: 6px;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.device-desktop .phabricator-nav-app {
|
||||
width: 37px;
|
||||
}
|
||||
|
||||
.device-desktop .phabricator-nav-head {
|
||||
display: none;
|
||||
}
|
||||
|
@ -173,24 +111,11 @@ span.phabricator-nav-app-item-icon {
|
|||
top: 0px;
|
||||
}
|
||||
|
||||
.device-tablet .phabricator-nav-app,
|
||||
.device-phone .phabricator-nav-app {
|
||||
left: -450px;
|
||||
}
|
||||
|
||||
.device-tablet .phabricator-nav-local,
|
||||
.device-phone .phabricator-nav-local {
|
||||
left: -300px;
|
||||
}
|
||||
|
||||
.device-phone .phabricator-nav-head-tablet {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.device-tablet .phabricator-nav-head-phone {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.device-tablet .phabricator-nav,
|
||||
.device-phone .phabricator-nav {
|
||||
overflow-x: hidden;
|
||||
|
@ -248,12 +173,6 @@ span.phabricator-nav-app-item-icon {
|
|||
border-radius: 0 6px 6px 0;
|
||||
}
|
||||
|
||||
.nav-button-apps {
|
||||
background-image: url(/rsrc/image/button_apps.png);
|
||||
background-size: 24px auto;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.nav-button-menu {
|
||||
background-image: url(/rsrc/image/button_menu.png);
|
||||
background-size: 24px auto;
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
JX.behavior('phabricator-nav', function(config) {
|
||||
|
||||
var app = JX.$(config.appID);
|
||||
var content = JX.$(config.contentID);
|
||||
var local = config.localID ? JX.$(config.localID) : null;
|
||||
var main = JX.$(config.mainID);
|
||||
|
@ -23,22 +22,20 @@ JX.behavior('phabricator-nav', function(config) {
|
|||
|
||||
var animations = [];
|
||||
function slide_menu(position) {
|
||||
var app_width = 150;
|
||||
var local_width = local ? 300 : 0;
|
||||
|
||||
var shifts = {
|
||||
0: 0,
|
||||
1: app_width - 10,
|
||||
2: app_width + local_width
|
||||
1: -10,
|
||||
2: local_width
|
||||
};
|
||||
var shift = shifts[position];
|
||||
|
||||
while (animations.length) {
|
||||
animations.pop().stop();
|
||||
}
|
||||
animations.push(build_animation(app, -shift));
|
||||
local && animations.push(build_animation(local, -shift + app_width));
|
||||
animations.push(build_animation(content, -shift + app_width + local_width));
|
||||
local && animations.push(build_animation(local, -shift));
|
||||
animations.push(build_animation(content, -shift + local_width));
|
||||
|
||||
select_button(position);
|
||||
}
|
||||
|
@ -53,9 +50,9 @@ JX.behavior('phabricator-nav', function(config) {
|
|||
// - Sliding Menu Buttons ------------------------------------------------------
|
||||
|
||||
var button_positions = {
|
||||
0: [JX.$('phone-menu1'), JX.$('tablet-menu1')],
|
||||
1: [JX.$('phone-menu2')],
|
||||
2: [JX.$('phone-menu3'), JX.$('tablet-menu2')]
|
||||
0: [JX.$('tablet-menu1')],
|
||||
1: [],
|
||||
2: [JX.$('tablet-menu2')]
|
||||
};
|
||||
|
||||
for (var k in button_positions) {
|
||||
|
@ -178,8 +175,8 @@ JX.behavior('phabricator-nav', function(config) {
|
|||
|
||||
// - Scroll --------------------------------------------------------------------
|
||||
|
||||
// When the user scrolls down on the desktop, we move the application and
|
||||
// local navs up until they hit the top of the page.
|
||||
// When the user scrolls down on the desktop, we move the local nav up until
|
||||
// it hits the top of the page.
|
||||
|
||||
JX.Stratcom.listen(['scroll', 'resize'], null, function(e) {
|
||||
if (JX.Device.getDevice() != 'desktop') {
|
||||
|
@ -187,18 +184,13 @@ JX.behavior('phabricator-nav', function(config) {
|
|||
}
|
||||
|
||||
var y = Math.max(0, 44 - JX.Vector.getScroll().y);
|
||||
app.style.top = y + 'px';
|
||||
if (local) {
|
||||
local.style.top = y + 'px';
|
||||
}
|
||||
local.style.top = y + 'px';
|
||||
});
|
||||
|
||||
|
||||
// - Navigation Reset ----------------------------------------------------------
|
||||
|
||||
JX.Stratcom.listen('phabricator-device-change', null, function(event) {
|
||||
app.style.left = '';
|
||||
app.style.top = '';
|
||||
if (local) {
|
||||
local.style.left = '';
|
||||
local.style.width = '';
|
||||
|
|
Loading…
Reference in a new issue