Explorar o código

Fix error on closing the last tab

Leonardo Jeanteur hai 1 ano
pai
achega
99dedb8bb5
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      bin/libs/goldenlayout.js

+ 2 - 2
bin/libs/goldenlayout.js

@@ -4404,9 +4404,9 @@ lm.utils.copy( lm.items.Stack.prototype, {
 		lm.items.AbstractContentItem.prototype.removeChild.call( this, contentItem, keepChild );
 		this.header.removeTab( contentItem );
 
-		if( activeIndex === index ) {
+		if( activeIndex === index && this.contentItems.length > 0 ) {
 			this.setActiveContentItem( this.contentItems[ Math.max( index - 1, 0 ) ] );
-		} else if( this.contentItems.length <= 0 ) {
+		} else {
 			this._activeContentItem = null;
 		}