File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6666 const editorMinWidth = " 20rem" ;
6767
6868 function sidebarSwitch () {
69+ if (! sidebarHidden && ! $items .find ((i ) => i .active )) {
70+ log .add (" Please select or create a new item first." , " info" , true );
71+ return ;
72+ }
6973 sidebarHidden = ! sidebarHidden;
7074 }
7175
168172 cursor : col-resize ;
169173 position : fixed ;
170174 inset : 0 ;
171- z-index : 200 ;
175+ z-index : 20 ;
172176 }
173177
174178 .splitter {
182186 left : calc (var (--sidebar-fixed-width ) - var (--splitter-offset ));
183187 width : var (--splitter-width );
184188 height : 100 svh;
185- z-index : 201 ;
189+ z-index : 21 ;
186190 transition : background-color 0.2s ease-in-out ;
187191
188192 &:hover,
Original file line number Diff line number Diff line change 8181 }
8282
8383 async function activate (item ) {
84- // if not in ready state or the item is already active
85- if (! $v4state . includes ( " ready " ) || item .active ) return ;
84+ // if item is empty or already active
85+ if (! item || item .active ) return ;
8686
8787 // check if there's a temp item and it's not the item to be activated
8888 // can occur when user clicks a non-temp item while a temp item exists
228228 title =" Open settings"
229229 {disabled }
230230 />
231- <Dropdown icon ={iconPlus } title ="New item" {disabled } right >
231+ <Dropdown icon ={iconPlus } title ="New item" {disabled }>
232232 <button on:click ={() => newItem (" js" )}>New JS</button >
233233 <button on:click ={() => newItem (" css" )}>New CSS</button >
234234 <button on:click ={newRemote }>New Remote</button >
You can’t perform that action at this time.
0 commit comments