mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-16 10:25:05 +02:00
fix
This commit is contained in:
parent
1211fcf75d
commit
ce6afd3deb
@ -4,13 +4,13 @@ import {pathEscapeSegments, pathUnescapeSegments} from '../utils/url.ts';
|
|||||||
import {GET, PUT} from '../modules/fetch.ts';
|
import {GET, PUT} from '../modules/fetch.ts';
|
||||||
import ViewFileTree from '../components/ViewFileTree.vue';
|
import ViewFileTree from '../components/ViewFileTree.vue';
|
||||||
|
|
||||||
async function toggleSidebar(sidebarEl: HTMLElement, visibility: boolean) {
|
async function toggleSidebar(sidebarEl: HTMLElement, shouldShow: boolean) {
|
||||||
const showBtnEl = sidebarEl.parentElement.querySelector('.show-tree-sidebar-button');
|
const showBtnEl = sidebarEl.parentElement.querySelector('.show-tree-sidebar-button');
|
||||||
const containerClassList = sidebarEl.parentElement.classList;
|
const containerClassList = sidebarEl.parentElement.classList;
|
||||||
containerClassList.toggle('repo-grid-tree-sidebar', visibility);
|
containerClassList.toggle('repo-grid-tree-sidebar', shouldShow);
|
||||||
containerClassList.toggle('repo-grid-filelist-only', !visibility);
|
containerClassList.toggle('repo-grid-filelist-only', !shouldShow);
|
||||||
toggleElem(sidebarEl, visibility);
|
toggleElem(sidebarEl, shouldShow);
|
||||||
toggleElem(showBtnEl, !visibility);
|
toggleElem(showBtnEl, !shouldShow);
|
||||||
|
|
||||||
// FIXME: need to remove "full height" style from parent element
|
// FIXME: need to remove "full height" style from parent element
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ async function toggleSidebar(sidebarEl: HTMLElement, visibility: boolean) {
|
|||||||
// save to session
|
// save to session
|
||||||
await PUT('/repo/preferences', {
|
await PUT('/repo/preferences', {
|
||||||
data: {
|
data: {
|
||||||
show_file_view_tree_sidebar: visibility,
|
show_file_view_tree_sidebar: shouldShow,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user