فهرست منبع

Inspector: Fix `Tab.isActive`

sunag 3 هفته پیش
والد
کامیت
33feff9e35
1فایلهای تغییر یافته به همراه17 افزوده شده و 1 حذف شده
  1. 17 1
      examples/jsm/inspector/ui/Tab.js

+ 17 - 1
examples/jsm/inspector/ui/Tab.js

@@ -40,7 +40,7 @@ export class Tab extends EventDispatcher {
 		this.content.id = `${this.id}-content`;
 		this.content.id = `${this.id}-content`;
 		this.content.className = 'profiler-content';
 		this.content.className = 'profiler-content';
 
 
-		this.isActive = false;
+		this._isActive = false;
 		this.isVisible = true;
 		this.isVisible = true;
 		this.isDetached = false;
 		this.isDetached = false;
 		this.detachedWindow = null;
 		this.detachedWindow = null;
@@ -60,6 +60,22 @@ export class Tab extends EventDispatcher {
 
 
 	}
 	}
 
 
+	get isActive() {
+
+		const isProfilerVisible = this.profiler && this.profiler.panel.classList.contains( 'visible' );
+
+		if ( ! isProfilerVisible ) return false;
+
+		return this.isDetached || this._isActive;
+
+	}
+
+	set isActive( value ) {
+
+		this._isActive = value;
+
+	}
+
 	init( /*inspector*/ ) { }
 	init( /*inspector*/ ) { }
 
 
 	update( /*inspector*/ ) { }
 	update( /*inspector*/ ) { }

粤ICP备19079148号