feat/resizable-panels #20
+23
@@ -1451,6 +1451,14 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ev.key === 'Escape' && $('main').classList.contains('focus-peek')) {
|
||||||
|
exitFocusPeek();
|
||||||
|
state.selectedIndex = -1;
|
||||||
|
renderEntityList();
|
||||||
|
renderDetailPane();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const sel = state.entities[state.selectedIndex];
|
const sel = state.entities[state.selectedIndex];
|
||||||
|
|
||||||
switch (ev.key) {
|
switch (ev.key) {
|
||||||
@@ -1534,6 +1542,17 @@
|
|||||||
|
|
||||||
function toggleZen() {
|
function toggleZen() {
|
||||||
const m = $('main');
|
const m = $('main');
|
||||||
|
|
||||||
|
if (m.classList.contains('focus-peek')) {
|
||||||
|
exitFocusPeek();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.selectedIndex >= 0) {
|
||||||
|
m.classList.add('focus-peek');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const isZen = m.classList.contains('hide-rail') && m.classList.contains('hide-peek');
|
const isZen = m.classList.contains('hide-rail') && m.classList.contains('hide-peek');
|
||||||
if (isZen) {
|
if (isZen) {
|
||||||
m.classList.remove('hide-rail', 'hide-peek');
|
m.classList.remove('hide-rail', 'hide-peek');
|
||||||
@@ -1546,6 +1565,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exitFocusPeek() {
|
||||||
|
$('main').classList.remove('focus-peek');
|
||||||
|
}
|
||||||
|
|
||||||
(function restorePanels() {
|
(function restorePanels() {
|
||||||
const m = $('main');
|
const m = $('main');
|
||||||
if (localStorage.getItem('nib:hide-rail')) m.classList.add('hide-rail');
|
if (localStorage.getItem('nib:hide-rail')) m.classList.add('hide-rail');
|
||||||
|
|||||||
@@ -193,6 +193,11 @@ main.hide-peek #detail-pane { overflow: hidden; border-left: none; min-width: 0;
|
|||||||
main.hide-rail .resize-handle[data-panel="rail"] { visibility: hidden; }
|
main.hide-rail .resize-handle[data-panel="rail"] { visibility: hidden; }
|
||||||
main.hide-peek .resize-handle[data-panel="peek"] { visibility: hidden; }
|
main.hide-peek .resize-handle[data-panel="peek"] { visibility: hidden; }
|
||||||
|
|
||||||
|
main.focus-peek { grid-template-columns: 0px 0px 0px 0px 1fr; }
|
||||||
|
main.focus-peek #tag-rail { overflow: hidden; border-right: none; min-width: 0; }
|
||||||
|
main.focus-peek #entity-panel { overflow: hidden; min-width: 0; }
|
||||||
|
main.focus-peek .resize-handle { visibility: hidden; }
|
||||||
|
|
||||||
.resize-handle {
|
.resize-handle {
|
||||||
cursor: col-resize;
|
cursor: col-resize;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|||||||
Reference in New Issue
Block a user