1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Add hotkey for hiding file tree

Summary:
In Differential, viewer can hit 'f' key to hide/show file tree on the left
side. Useful on narrow monitors.

Test Plan: Open any diff in Differential tool, hit 'f', watch file tree disappears

Reviewers: vrana, mattchoi, epriestley

Reviewed By: vrana

CC: aran, epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D3844
This commit is contained in:
Alex Kotliarskyi 2012-10-30 17:22:20 -07:00
parent fe8351c930
commit 209954f28c
3 changed files with 24 additions and 0 deletions

View file

@ -95,6 +95,18 @@
margin-left: 216px; margin-left: 216px;
} }
.device-desktop .local-nav-collapsed .phabricator-nav-local {
width: 0px !important;
}
.device-desktop .local-nav-collapsed .phabricator-nav-drag {
display: none;
}
.device-desktop .local-nav-collapsed .phabricator-nav-content {
margin-left: 2.5em !important;
}
.phabricator-nav-col span { .phabricator-nav-col span {
display: block; display: block;
font-weight: bold; font-weight: bold;

View file

@ -16,6 +16,7 @@ JX.behavior('phabricator-nav', function(config) {
var app = JX.$(config.appID); var app = JX.$(config.appID);
var content = JX.$(config.contentID); var content = JX.$(config.contentID);
var local = config.localID ? JX.$(config.localID) : null; var local = config.localID ? JX.$(config.localID) : null;
var main = JX.$(config.mainID);
// - Sliding Menu Animations --------------------------------------------------- // - Sliding Menu Animations ---------------------------------------------------
@ -166,6 +167,12 @@ JX.behavior('phabricator-nav', function(config) {
JX.DOM.alterClass(document.body, 'jx-drag-col', false); JX.DOM.alterClass(document.body, 'jx-drag-col', false);
dragging = false; dragging = false;
}); });
var collapsed = false;
JX.Stratcom.listen('differential-filetree-toggle', null, function(e) {
collapsed = !collapsed;
JX.DOM.alterClass(main, 'local-nav-collapsed', collapsed);
});
} }

View file

@ -224,6 +224,11 @@ JX.behavior('differential-keyboard-navigation', function(config) {
}) })
.register(); .register();
new JX.KeyboardShortcut('f', 'Toggle file tree.')
.setHandler(function(manager) {
JX.Stratcom.invoke('differential-filetree-toggle');
})
.register();
new JX.KeyboardShortcut('h', 'Collapse or expand the file display.') new JX.KeyboardShortcut('h', 'Collapse or expand the file display.')
.setHandler(function(manager) { .setHandler(function(manager) {