@@ -4,13 +4,13 @@ import {pathEscapeSegments, pathUnescapeSegments} from '../utils/url.ts';
44import { GET , PUT } from '../modules/fetch.ts' ;
55import ViewFileTree from '../components/ViewFileTree.vue' ;
66
7- async function toggleSidebar ( sidebarEl : HTMLElement , visibility : boolean ) {
7+ async function toggleSidebar ( sidebarEl : HTMLElement , shouldShow : boolean ) {
88 const showBtnEl = sidebarEl . parentElement . querySelector ( '.show-tree-sidebar-button' ) ;
99 const containerClassList = sidebarEl . parentElement . classList ;
10- containerClassList . toggle ( 'repo-grid-tree-sidebar' , visibility ) ;
11- containerClassList . toggle ( 'repo-grid-filelist-only' , ! visibility ) ;
12- toggleElem ( sidebarEl , visibility ) ;
13- toggleElem ( showBtnEl , ! visibility ) ;
10+ containerClassList . toggle ( 'repo-grid-tree-sidebar' , shouldShow ) ;
11+ containerClassList . toggle ( 'repo-grid-filelist-only' , ! shouldShow ) ;
12+ toggleElem ( sidebarEl , shouldShow ) ;
13+ toggleElem ( showBtnEl , ! shouldShow ) ;
1414
1515 // FIXME: need to remove "full height" style from parent element
1616
@@ -19,7 +19,7 @@ async function toggleSidebar(sidebarEl: HTMLElement, visibility: boolean) {
1919 // save to session
2020 await PUT ( '/repo/preferences' , {
2121 data : {
22- show_file_view_tree_sidebar : visibility ,
22+ show_file_view_tree_sidebar : shouldShow ,
2323 } ,
2424 } ) ;
2525}
0 commit comments