mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Remove collapsable option from ProfileMenu
Summary: Never really used this to full potential and takes up a lot of code and space. Remove option for now and make all profile nav menus small by default. Test Plan: Review user, project, workboard. Set new menus. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T5867 Differential Revision: https://secure.phabricator.com/D17206
This commit is contained in:
parent
7276af6a81
commit
36e53fd5d0
7 changed files with 15 additions and 306 deletions
|
@ -9,7 +9,7 @@ return array(
|
|||
'names' => array(
|
||||
'conpherence.pkg.css' => '0b64e988',
|
||||
'conpherence.pkg.js' => '6249a1cf',
|
||||
'core.pkg.css' => '9c725fa0',
|
||||
'core.pkg.css' => '1afa1d13',
|
||||
'core.pkg.js' => 'a2ead3fe',
|
||||
'darkconsole.pkg.js' => 'e7393ebb',
|
||||
'differential.pkg.css' => '9535a7e6',
|
||||
|
@ -162,7 +162,7 @@ return array(
|
|||
'rsrc/css/phui/phui-object-box.css' => '6b487c57',
|
||||
'rsrc/css/phui/phui-pager.css' => 'bea33d23',
|
||||
'rsrc/css/phui/phui-pinboard-view.css' => '2495140e',
|
||||
'rsrc/css/phui/phui-profile-menu.css' => '4768721a',
|
||||
'rsrc/css/phui/phui-profile-menu.css' => 'c71ecdcd',
|
||||
'rsrc/css/phui/phui-property-list-view.css' => '6d8e58ac',
|
||||
'rsrc/css/phui/phui-remarkup-preview.css' => '1a8f2591',
|
||||
'rsrc/css/phui/phui-segment-bar-view.css' => '46342871',
|
||||
|
@ -172,7 +172,7 @@ return array(
|
|||
'rsrc/css/phui/phui-timeline-view.css' => 'bc523970',
|
||||
'rsrc/css/phui/phui-two-column-view.css' => '7babf5b9',
|
||||
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'b60ef38a',
|
||||
'rsrc/css/phui/workboards/phui-workboard.css' => '16441d5e',
|
||||
'rsrc/css/phui/workboards/phui-workboard.css' => 'c88912ee',
|
||||
'rsrc/css/phui/workboards/phui-workcard.css' => '00979e40',
|
||||
'rsrc/css/phui/workboards/phui-workpanel.css' => 'a3a63478',
|
||||
'rsrc/css/sprite-login.css' => '587d92d7',
|
||||
|
@ -535,7 +535,6 @@ return array(
|
|||
'rsrc/js/core/phtize.js' => 'd254d646',
|
||||
'rsrc/js/phui/behavior-phui-dropdown-menu.js' => '1aa4c968',
|
||||
'rsrc/js/phui/behavior-phui-file-upload.js' => 'b003d4fb',
|
||||
'rsrc/js/phui/behavior-phui-profile-menu.js' => '12884df9',
|
||||
'rsrc/js/phui/behavior-phui-submenu.js' => 'a6f7a73b',
|
||||
'rsrc/js/phui/behavior-phui-tab-group.js' => '0a0b10e9',
|
||||
'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8',
|
||||
|
@ -690,7 +689,6 @@ return array(
|
|||
'javelin-behavior-phui-dropdown-menu' => '1aa4c968',
|
||||
'javelin-behavior-phui-file-upload' => 'b003d4fb',
|
||||
'javelin-behavior-phui-hovercards' => 'bcaccd64',
|
||||
'javelin-behavior-phui-profile-menu' => '12884df9',
|
||||
'javelin-behavior-phui-submenu' => 'a6f7a73b',
|
||||
'javelin-behavior-phui-tab-group' => '0a0b10e9',
|
||||
'javelin-behavior-policy-control' => 'd0c516d5',
|
||||
|
@ -883,7 +881,7 @@ return array(
|
|||
'phui-oi-simple-ui-css' => 'a8beebea',
|
||||
'phui-pager-css' => 'bea33d23',
|
||||
'phui-pinboard-view-css' => '2495140e',
|
||||
'phui-profile-menu-css' => '4768721a',
|
||||
'phui-profile-menu-css' => 'c71ecdcd',
|
||||
'phui-property-list-view-css' => '6d8e58ac',
|
||||
'phui-remarkup-preview-css' => '1a8f2591',
|
||||
'phui-segment-bar-view-css' => '46342871',
|
||||
|
@ -894,7 +892,7 @@ return array(
|
|||
'phui-timeline-view-css' => 'bc523970',
|
||||
'phui-two-column-view-css' => '7babf5b9',
|
||||
'phui-workboard-color-css' => 'b60ef38a',
|
||||
'phui-workboard-view-css' => '16441d5e',
|
||||
'phui-workboard-view-css' => 'c88912ee',
|
||||
'phui-workcard-view-css' => '00979e40',
|
||||
'phui-workpanel-view-css' => 'a3a63478',
|
||||
'phuix-action-list-view' => 'b5c256b8',
|
||||
|
@ -1030,11 +1028,6 @@ return array(
|
|||
'javelin-dom',
|
||||
'javelin-typeahead-normalizer',
|
||||
),
|
||||
'12884df9' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
'javelin-dom',
|
||||
),
|
||||
'13c739ea' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
|
|
|
@ -3422,7 +3422,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPolicyTestObject' => 'applications/policy/__tests__/PhabricatorPolicyTestObject.php',
|
||||
'PhabricatorPolicyType' => 'applications/policy/constants/PhabricatorPolicyType.php',
|
||||
'PhabricatorPonderApplication' => 'applications/ponder/application/PhabricatorPonderApplication.php',
|
||||
'PhabricatorProfileMenuCollapsedSetting' => 'applications/settings/setting/PhabricatorProfileMenuCollapsedSetting.php',
|
||||
'PhabricatorProfileMenuEditEngine' => 'applications/search/editor/PhabricatorProfileMenuEditEngine.php',
|
||||
'PhabricatorProfileMenuEditor' => 'applications/search/editor/PhabricatorProfileMenuEditor.php',
|
||||
'PhabricatorProfileMenuEngine' => 'applications/search/engine/PhabricatorProfileMenuEngine.php',
|
||||
|
@ -8575,7 +8574,6 @@ phutil_register_library_map(array(
|
|||
),
|
||||
'PhabricatorPolicyType' => 'PhabricatorPolicyConstants',
|
||||
'PhabricatorPonderApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorProfileMenuCollapsedSetting' => 'PhabricatorInternalSetting',
|
||||
'PhabricatorProfileMenuEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhabricatorProfileMenuEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhabricatorProfileMenuEngine' => 'Phobject',
|
||||
|
|
|
@ -239,11 +239,6 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
|
|||
}
|
||||
}
|
||||
|
||||
$more_items = $this->newAutomaticMenuItems($nav);
|
||||
foreach ($more_items as $item) {
|
||||
$nav->addMenuItem($item);
|
||||
}
|
||||
|
||||
$nav->selectFilter(null);
|
||||
|
||||
$this->navigation = $nav;
|
||||
|
@ -410,73 +405,6 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
|
|||
}
|
||||
}
|
||||
|
||||
private function newAutomaticMenuItems(AphrontSideNavFilterView $nav) {
|
||||
$items = array();
|
||||
|
||||
// NOTE: We're adding a spacer item for the fixed footer, so that if the
|
||||
// menu taller than the page content you can still scroll down the page far
|
||||
// enough to access the last item without the content being obscured by the
|
||||
// fixed items.
|
||||
$items[] = id(new PHUIListItemView())
|
||||
->setHideInApplicationMenu(true)
|
||||
->addClass('phui-profile-menu-spacer');
|
||||
|
||||
$collapse_id = celerity_generate_unique_node_id();
|
||||
$viewer = $this->getViewer();
|
||||
$collapse_key = PhabricatorProfileMenuCollapsedSetting::SETTINGKEY;
|
||||
|
||||
$is_collapsed = $viewer->getUserSetting($collapse_key);
|
||||
|
||||
if ($is_collapsed) {
|
||||
$nav->addClass('phui-profile-menu-collapsed');
|
||||
} else {
|
||||
$nav->addClass('phui-profile-menu-expanded');
|
||||
}
|
||||
|
||||
if ($viewer->isLoggedIn()) {
|
||||
$settings_uri = '/settings/adjust/?key='.$collapse_key;
|
||||
} else {
|
||||
$settings_uri = null;
|
||||
}
|
||||
|
||||
Javelin::initBehavior(
|
||||
'phui-profile-menu',
|
||||
array(
|
||||
'menuID' => $nav->getMainID(),
|
||||
'collapseID' => $collapse_id,
|
||||
'isCollapsed' => (bool)$is_collapsed,
|
||||
'settingsURI' => $settings_uri,
|
||||
));
|
||||
|
||||
$collapse_icon = id(new PHUIIconCircleView())
|
||||
->addClass('phui-list-item-icon')
|
||||
->addClass('phui-profile-menu-visible-when-expanded')
|
||||
->setIcon('fa-chevron-left');
|
||||
|
||||
$expand_icon = id(new PHUIIconCircleView())
|
||||
->addClass('phui-list-item-icon')
|
||||
->addClass('phui-profile-menu-visible-when-collapsed')
|
||||
->addSigil('has-tooltip')
|
||||
->setMetadata(
|
||||
array(
|
||||
'tip' => pht('Expand'),
|
||||
'align' => 'E',
|
||||
))
|
||||
->setIcon('fa-chevron-right');
|
||||
|
||||
$items[] = id(new PHUIListItemView())
|
||||
->setName('Collapse')
|
||||
->addIcon($collapse_icon)
|
||||
->addIcon($expand_icon)
|
||||
->setID($collapse_id)
|
||||
->addClass('phui-profile-menu-footer')
|
||||
->addClass('phui-profile-menu-footer-1')
|
||||
->setHideInApplicationMenu(true)
|
||||
->setHref('#');
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
public function getConfigureURI() {
|
||||
return $this->getItemURI('configure/');
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorProfileMenuCollapsedSetting
|
||||
extends PhabricatorInternalSetting {
|
||||
|
||||
const SETTINGKEY = 'profile-menu.collapsed';
|
||||
|
||||
public function getSettingName() {
|
||||
return pht('Profile Menu Collapsed');
|
||||
}
|
||||
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
* @provides phui-profile-menu-css
|
||||
*/
|
||||
|
||||
.device-desktop .phui-profile-menu-collapsed .phabricator-nav-local {
|
||||
.device-desktop .phui-profile-menu .phabricator-nav-local {
|
||||
width: {$menu.profile.width.collapsed};
|
||||
max-width: {$menu.profile.width.collapsed};
|
||||
}
|
||||
|
@ -58,8 +58,7 @@
|
|||
background-size: 100%;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-list-item-href {
|
||||
.phui-profile-menu .phabricator-side-menu .phui-list-item-href {
|
||||
text-align: center;
|
||||
padding: 42px 4px 14px;
|
||||
line-height: 14px;
|
||||
|
@ -67,19 +66,17 @@
|
|||
font-size: {$smallerfontsize};
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-list-item-name {
|
||||
.phui-profile-menu .phabricator-side-menu .phui-list-item-name {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-list-item-icon,
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-list-item-href .phui-list-item-icon {
|
||||
top: 14px;
|
||||
left: 32px;
|
||||
.phui-profile-menu .phabricator-side-menu .phui-list-item-icon,
|
||||
.phui-profile-menu .phabricator-side-menu .phui-list-item-href
|
||||
.phui-list-item-icon {
|
||||
top: 14px;
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phabricator-side-menu
|
||||
|
@ -131,14 +128,12 @@
|
|||
padding: 16px;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-profile-menu-error {
|
||||
.phui-profile-menu .phabricator-side-menu .phui-profile-menu-error {
|
||||
padding: 16px 8px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
|
||||
.phui-profile-menu .phabricator-side-menu .phui-list-item-disabled
|
||||
.phui-list-item-href,
|
||||
.phui-profile-menu .phui-list-sidenav .phui-list-item-disabled
|
||||
|
@ -153,150 +148,15 @@
|
|||
padding: 8px 12px 16px;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-profile-segment-bar {
|
||||
.phui-profile-menu .phabricator-side-menu .phui-profile-segment-bar {
|
||||
padding: 8px 8px 16px;
|
||||
}
|
||||
|
||||
|
||||
.phui-profile-menu .phabricator-side-menu .phui-profile-menu-spacer {
|
||||
box-sizing: border-box;
|
||||
height: {$menu.profile.item.height};
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-profile-menu-footer
|
||||
.phui-list-item-name {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-expanded
|
||||
.phui-profile-menu-visible-when-collapsed,
|
||||
.phui-profile-menu .phui-profile-menu-collapsed
|
||||
.phui-profile-menu-visible-when-expanded {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-profile-menu-footer .phui-list-item-href {
|
||||
padding: 20px 0 24px;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phabricator-side-menu .phui-profile-menu-footer
|
||||
.phui-list-item-href:hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phabricator-side-menu
|
||||
.phui-profile-menu-footer .phui-list-item-href .phui-list-item-icon {
|
||||
top: 8px;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-footer .phui-icon-circle {
|
||||
border-color: {$darkbluetext};
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-footer .phui-icon-circle .phui-icon-view {
|
||||
color: {$darkbluetext};
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-footer
|
||||
.phui-icon-circle.phui-list-item-icon {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phabricator-side-menu .phui-profile-menu-footer-1 {
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-footer-1 {
|
||||
width: {$menu.profile.width};
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsed .phui-profile-menu-footer-1 {
|
||||
width: {$menu.profile.width.collapsed};
|
||||
}
|
||||
|
||||
.phui-profile-menu .phabricator-side-menu
|
||||
.phui-list-item-selected.phui-profile-menu-footer .phui-list-item-href {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsing
|
||||
.phabricator-nav-local {
|
||||
animation: profile-menu-collapse 0.2s;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-expanding
|
||||
.phabricator-nav-local {
|
||||
animation: profile-menu-expand 0.2s;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-collapsing
|
||||
.phabricator-side-menu .phui-list-item-href {
|
||||
animation: profile-menu-blink 0.2s;
|
||||
}
|
||||
|
||||
.phui-profile-menu .phui-profile-menu-expanding
|
||||
.phabricator-side-menu .phui-list-item-href {
|
||||
animation: profile-menu-blink 0.2s;
|
||||
}
|
||||
|
||||
@keyframes profile-menu-blink {
|
||||
0% {
|
||||
opacity: 1.0;
|
||||
}
|
||||
25% {
|
||||
opacity: 0.0;
|
||||
}
|
||||
75% {
|
||||
opacity: 0.0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes profile-menu-collapse {
|
||||
0% {
|
||||
width: {$menu.profile.width};
|
||||
max-width: {$menu.profile.width};
|
||||
}
|
||||
33% {
|
||||
width: {$menu.profile.width};
|
||||
max-width: {$menu.profile.width};
|
||||
}
|
||||
66% {
|
||||
width: {$menu.profile.width.collapsed};
|
||||
max-width: {$menu.profile.width.collapsed};
|
||||
}
|
||||
100% {
|
||||
width: {$menu.profile.width.collapsed};
|
||||
max-width: {$menu.profile.width.collapsed};
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes profile-menu-expand {
|
||||
0% {
|
||||
width: {$menu.profile.width.collapsed};
|
||||
max-width: {$menu.profile.width.collapsed};
|
||||
}
|
||||
33% {
|
||||
width: {$menu.profile.width.collapsed};
|
||||
max-width: {$menu.profile.width.collapsed};
|
||||
}
|
||||
66% {
|
||||
width: {$menu.profile.width};
|
||||
max-width: {$menu.profile.width};
|
||||
}
|
||||
100% {
|
||||
width: {$menu.profile.width};
|
||||
max-width: {$menu.profile.width};
|
||||
}
|
||||
}
|
||||
|
||||
!print .phui-profile-menu .phabricator-side-menu {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -32,11 +32,6 @@
|
|||
}
|
||||
|
||||
.device-desktop .project-board-wrapper .phui-workboard-view-shadow {
|
||||
left: {$menu.profile.width};
|
||||
}
|
||||
|
||||
.device-desktop .phui-profile-menu-collapsed .project-board-wrapper
|
||||
.phui-workboard-view-shadow {
|
||||
left: {$menu.profile.width.collapsed};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
/**
|
||||
* @provides javelin-behavior-phui-profile-menu
|
||||
* @requires javelin-behavior
|
||||
* javelin-stratcom
|
||||
* javelin-dom
|
||||
*/
|
||||
|
||||
JX.behavior('phui-profile-menu', function(config) {
|
||||
// NOTE: This behavior is not initialized in the rendering pipeline for the
|
||||
// menu, so it can get initialized when we build but do not render a menu
|
||||
// (for example, when a page like the panel edit page only has items in
|
||||
// the mobile/application menu, and does not show the profile menu). For now,
|
||||
// just bail if we can't find the menu.
|
||||
|
||||
try {
|
||||
var menu_node = JX.$(config.menuID);
|
||||
} catch (ex) {
|
||||
return;
|
||||
}
|
||||
|
||||
var collapse_node = JX.$(config.collapseID);
|
||||
|
||||
var is_collapsed = config.isCollapsed;
|
||||
|
||||
JX.DOM.listen(collapse_node, 'click', null, function(e) {
|
||||
is_collapsed = !is_collapsed;
|
||||
|
||||
JX.DOM.alterClass(menu_node, 'phui-profile-menu-collapsing', is_collapsed);
|
||||
JX.DOM.alterClass(menu_node, 'phui-profile-menu-expanding', !is_collapsed);
|
||||
|
||||
var duration = 0.2;
|
||||
|
||||
setTimeout(function() {
|
||||
JX.DOM.alterClass(menu_node, 'phui-profile-menu-collapsed', is_collapsed);
|
||||
JX.DOM.alterClass(menu_node, 'phui-profile-menu-expanded', !is_collapsed);
|
||||
}, (duration / 2) * 1000);
|
||||
|
||||
setTimeout(function() {
|
||||
JX.DOM.alterClass(menu_node, 'phui-profile-menu-collapsing', false);
|
||||
JX.DOM.alterClass(menu_node, 'phui-profile-menu-expanding', false);
|
||||
}, duration * 1000);
|
||||
|
||||
|
||||
if (config.settingsURI) {
|
||||
new JX.Request(config.settingsURI)
|
||||
.setData({value: (is_collapsed ? 1 : 0)})
|
||||
.send();
|
||||
}
|
||||
|
||||
e.kill();
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in a new issue