File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default function EditorHeader() {
15
15
prefs . subscribe ( 'editor.keyMap' , showHotkeyInTooltip , true ) ;
16
16
window . on ( 'showHotkeyInTooltip' , showHotkeyInTooltip ) ;
17
17
} , { once : true } ) ;
18
- for ( const el of $$ ( '#header details ' ) ) {
18
+ for ( const el of $$ ( '#header summary ' ) ) {
19
19
el . on ( 'contextmenu' , peekDetails ) ;
20
20
}
21
21
}
@@ -58,12 +58,13 @@ function initNameArea() {
58
58
59
59
async function peekDetails ( evt ) {
60
60
evt . preventDefault ( ) ;
61
- this . open = true ;
62
- while ( this . matches ( ':hover, :active' ) ) {
61
+ const elDetails = this . parentNode ;
62
+ if ( ! ( elDetails . open = ! elDetails . open ) ) return ;
63
+ while ( elDetails . matches ( ':hover, :active' ) ) {
63
64
await sleep ( 500 ) ;
64
- await new Promise ( cb => this . on ( 'mouseleave' , cb , { once : true } ) ) ;
65
+ await new Promise ( cb => elDetails . on ( 'mouseleave' , cb , { once : true } ) ) ;
65
66
}
66
- this . open = false ;
67
+ elDetails . open = false ;
67
68
}
68
69
69
70
function showHotkeyInTooltip ( _ , mapName = prefs . get ( 'editor.keyMap' ) ) {
You can’t perform that action at this time.
0 commit comments