This repository was archived by the owner on Jun 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,13 @@ import { t } from "../../services/i18n.js";
55import type { EventData } from "../../components/app_context.js" ;
66
77export default class LeftPaneToggleWidget extends CommandButtonWidget {
8+ private currentLeftPaneVisible : boolean ;
89
910 constructor ( isHorizontalLayout : boolean ) {
1011 super ( ) ;
1112
13+ this . currentLeftPaneVisible = options . is ( "leftPaneVisible" ) ;
14+
1215 this . class ( isHorizontalLayout ? "toggle-button" : "launcher-button" ) ;
1316
1417 this . settings . icon = ( ) => {
@@ -21,21 +24,23 @@ export default class LeftPaneToggleWidget extends CommandButtonWidget {
2124
2225 this . settings . title = ( ) => ( options . is ( "leftPaneVisible" ) ? t ( "left_pane_toggle.hide_panel" ) : t ( "left_pane_toggle.show_panel" ) ) ;
2326
24- this . settings . command = ( ) => ( options . is ( "leftPaneVisible" ) ? "hideLeftPane" : "showLeftPane" ) ;
27+ this . settings . command = ( ) => ( this . currentLeftPaneVisible ? "hideLeftPane" : "showLeftPane" ) ;
2528
2629 if ( isHorizontalLayout ) {
2730 this . settings . titlePlacement = "bottom" ;
2831 }
2932 }
3033
3134 refreshIcon ( ) {
32- super . refreshIcon ( ) ;
33-
34- splitService . setupLeftPaneResizer ( options . is ( "leftPaneVisible" ) ) ;
35+ if ( document . hasFocus ( ) || this . currentLeftPaneVisible === true ) {
36+ super . refreshIcon ( ) ;
37+ splitService . setupLeftPaneResizer ( this . currentLeftPaneVisible ) ;
38+ }
3539 }
3640
3741 entitiesReloadedEvent ( { loadResults } : EventData < "entitiesReloaded" > ) {
38- if ( loadResults . isOptionReloaded ( "leftPaneVisible" ) ) {
42+ if ( loadResults . isOptionReloaded ( "leftPaneVisible" ) && document . hasFocus ( ) ) {
43+ this . currentLeftPaneVisible = options . is ( "leftPaneVisible" ) ;
3944 this . refreshIcon ( ) ;
4045 }
4146 }
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default class LeftPaneContainer extends FlexContainer<Component> {
1717 }
1818
1919 entitiesReloadedEvent ( { loadResults } : EventData < "entitiesReloaded" > ) {
20- if ( loadResults . isOptionReloaded ( "leftPaneVisible" ) ) {
20+ if ( loadResults . isOptionReloaded ( "leftPaneVisible" ) && document . hasFocus ( ) ) {
2121 const visible = this . isEnabled ( ) ;
2222 this . toggleInt ( visible ) ;
2323
You can’t perform that action at this time.
0 commit comments