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:
@@ -6,7 +6,6 @@
|
||||
* javelin-dom
|
||||
* javelin-magical-init
|
||||
* javelin-vector
|
||||
* javelin-request
|
||||
* javelin-util
|
||||
* javelin-fx
|
||||
* @javelin
|
||||
@@ -85,48 +84,6 @@ JX.behavior('phabricator-nav', function(config) {
|
||||
}
|
||||
|
||||
|
||||
// - Application Menu Collapse/Expand ------------------------------------------
|
||||
|
||||
function collapse(state, skip_save) {
|
||||
// As necessary, adjust the drag bar and content positioning. Do this first,
|
||||
// so we don't end up measuring things after the collapse takes effect.
|
||||
|
||||
// This is the difference between the widths of the uncollapsed application
|
||||
// nav (150px) and the collapsed one (38px).
|
||||
var delta = 112;
|
||||
delta = state ? -delta : delta;
|
||||
if (config.dragID) {
|
||||
var drag = JX.$(config.dragID);
|
||||
var p = JX.$V(drag);
|
||||
p.x += delta;
|
||||
p.y = null;
|
||||
p.setPos(drag);
|
||||
}
|
||||
|
||||
var c = parseInt(getComputedStyle(content).marginLeft, 10);
|
||||
content.style.marginLeft = (c + delta) + 'px';
|
||||
|
||||
JX.DOM.alterClass(
|
||||
JX.$(config.mainID),
|
||||
'phabricator-nav-app-collapsed',
|
||||
state);
|
||||
|
||||
if (!skip_save) {
|
||||
new JX.Request('/settings/adjust/', JX.bag)
|
||||
.setData({key: config.collapseKey, value: state ? 1 : ''})
|
||||
.send();
|
||||
}
|
||||
}
|
||||
|
||||
JX.DOM.listen(JX.$(config.collapseID), 'click', null, function(e) {
|
||||
collapse(true);
|
||||
});
|
||||
|
||||
JX.DOM.listen(JX.$(config.expandID), 'click', null, function(e) {
|
||||
collapse(false);
|
||||
});
|
||||
|
||||
|
||||
// - Flexible Navigation Column ------------------------------------------------
|
||||
|
||||
if (config.dragID) {
|
||||
|
||||
Reference in New Issue
Block a user