Always collapse the left nav on desktops

Summary:
There is basically no reason for anyone to ever use the uncollapsed mode for more than the first 2 minutes of using the tool.

Delete all code related to collapse/expand.

(I'm going to add tooltips next.)

Also move the drag bar a few pixels to the right, so it does not overlap with the scrollbar on the "local" nav if there is one.

Test Plan: Viewed in desktop/tablet/phone modes.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3413
This commit is contained in:
epriestley
2012-08-30 18:58:59 -07:00
parent c4ed47929c
commit 5c006193dd
5 changed files with 11 additions and 134 deletions

View File

@@ -1518,7 +1518,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-phabricator-nav' =>
array(
'uri' => '/res/dc349915/rsrc/js/application/core/behavior-phabricator-nav.js',
'uri' => '/res/6e550189/rsrc/js/application/core/behavior-phabricator-nav.js',
'type' => 'js',
'requires' =>
array(
@@ -1528,9 +1528,8 @@ celerity_register_resource_map(array(
3 => 'javelin-dom',
4 => 'javelin-magical-init',
5 => 'javelin-vector',
6 => 'javelin-request',
7 => 'javelin-util',
8 => 'javelin-fx',
6 => 'javelin-util',
7 => 'javelin-fx',
),
'disk' => '/rsrc/js/application/core/behavior-phabricator-nav.js',
),
@@ -2477,7 +2476,7 @@ celerity_register_resource_map(array(
),
'phabricator-nav-view-css' =>
array(
'uri' => '/res/289a0aed/rsrc/css/aphront/phabricator-nav-view.css',
'uri' => '/res/1d3e1353/rsrc/css/aphront/phabricator-nav-view.css',
'type' => 'css',
'requires' =>
array(

View File

@@ -33,7 +33,6 @@ final class PhabricatorUserPreferences extends PhabricatorUserDAO {
const PREFERENCE_DIFFUSION_VIEW = 'diffusion-view';
const PREFERENCE_DIFFUSION_SYMBOLS = 'diffusion-symbols';
const PREFERENCE_NAV_COLLAPSED = 'nav-collapsed';
const PREFERENCE_NAV_WIDTH = 'nav-width';
protected $userPHID;

View File

@@ -77,48 +77,19 @@ final class AphrontSideNavView extends AphrontView {
$nav_id = null;
$drag_id = null;
$content_id = celerity_generate_unique_node_id();
$collapse_id = null;
$expand_id = null;
$local_id = null;
$local_menu = null;
$main_id = celerity_generate_unique_node_id();
$apps = $this->renderApplications();
$key = PhabricatorUserPreferences::PREFERENCE_NAV_COLLAPSED;
if ($user->loadPreferences()->getPreference($key)) {
$nav_classes[] = 'phabricator-nav-app-collapsed';
}
$collapse_id = celerity_generate_unique_node_id();
$expand_id = celerity_generate_unique_node_id();
$collapse_button = phutil_render_tag(
'a',
array(
'href' => '#',
'class' => 'phabricator-nav-app-button-collapse',
'id' => $collapse_id,
),
'« Collapse');
$expand_button = phutil_render_tag(
'a',
array(
'href' => '#',
'class' => 'phabricator-nav-app-button-expand',
'id' => $expand_id,
),
'»');
$app_menu = phutil_render_tag(
'div',
array(
'class' => 'phabricator-nav-col phabricator-nav-app',
'id' => $app_id,
),
$apps->render()).
$expand_button.
$collapse_button;
$apps->render());
if ($this->flexible) {
$drag_id = celerity_generate_unique_node_id();
@@ -154,9 +125,6 @@ final class AphrontSideNavView extends AphrontView {
'localID' => $local_id,
'dragID' => $drag_id,
'contentID' => $content_id,
'collapseID' => $collapse_id,
'expandID' => $expand_id,
'collapseKey' => $key,
));
if ($this->active && $local_id) {