Skip to content

Commit 33feff9

Browse files
committed
Inspector: Fix Tab.isActive
1 parent a567d36 commit 33feff9

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

  • examples/jsm/inspector/ui

examples/jsm/inspector/ui/Tab.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class Tab extends EventDispatcher {
4040
this.content.id = `${this.id}-content`;
4141
this.content.className = 'profiler-content';
4242

43-
this.isActive = false;
43+
this._isActive = false;
4444
this.isVisible = true;
4545
this.isDetached = false;
4646
this.detachedWindow = null;
@@ -60,6 +60,22 @@ export class Tab extends EventDispatcher {
6060

6161
}
6262

63+
get isActive() {
64+
65+
const isProfilerVisible = this.profiler && this.profiler.panel.classList.contains( 'visible' );
66+
67+
if ( ! isProfilerVisible ) return false;
68+
69+
return this.isDetached || this._isActive;
70+
71+
}
72+
73+
set isActive( value ) {
74+
75+
this._isActive = value;
76+
77+
}
78+
6379
init( /*inspector*/ ) { }
6480

6581
update( /*inspector*/ ) { }

0 commit comments

Comments
 (0)