sunag 3 недель назад
Родитель
Сommit
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.className = 'profiler-content';
 
-		this.isActive = false;
+		this._isActive = false;
 		this.isVisible = true;
 		this.isDetached = false;
 		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*/ ) { }
 
 	update( /*inspector*/ ) { }

粤ICP备19079148号