website/files/v0.9.2/js/goldenlayout.js
function() {
		var availableWidth = this.element.outerWidth() - this.controlsContainer.outerWidth(),
			totalTabWidth = 0,
			tabElement,
			i,
			marginLeft,
			gap;

		for( i = 0; i < this.tabs.length; i++ ) {
			tabElement = this.tabs[ i ].element;

			/*
			 * In order to show every tab's close icon, decrement the z-index from left to right
			 */
			tabElement.css( 'z-index', this.tabs.length - i );
			totalTabWidth += tabElement.outerWidth() + parseInt( tabElement.css( 'margin-right' ), 10 );
		}

		gap = ( totalTabWidth - availableWidth ) / ( this.tabs.length - 1 )

		for( i = 0; i < this.tabs.length; i++ ) {

			/*
			 * The active tab keeps it's original width
			 */
			if( !this.tabs[ i ].isActive && gap > 0 ) {
				marginLeft = '-' + Math.floor( gap )+ 'px';
			} else {
				marginLeft = '';
			}

			this.tabs[ i ].element.css( 'margin-left', marginLeft );
		}

		if( this.element.outerWidth() < this.tabs[ 0 ].element.outerWidth() ) {
			this.element.css( 'overflow', 'hidden' );
		} else {
			this.element.css( 'overflow', 'visible' );
		}
	}
function() {
		var availableWidth = this.element.outerWidth() - this.controlsContainer.outerWidth(),
			totalTabWidth = 0,
			tabElement,
			i,
			marginLeft,
			gap;

		for( i = 0; i < this.tabs.length; i++ ) {
			tabElement = this.tabs[ i ].element;

			/*
			 * In order to show every tab's close icon, decrement the z-index from left to right
			 */
			tabElement.css( 'z-index', this.tabs.length - i );
			totalTabWidth += tabElement.outerWidth() + parseInt( tabElement.css( 'margin-right' ), 10 );
		}

		gap = ( totalTabWidth - availableWidth ) / ( this.tabs.length - 1 )

		for( i = 0; i < this.tabs.length; i++ ) {

			/*
			 * The active tab keeps it's original width
			 */
			if( !this.tabs[ i ].isActive && gap > 0 ) {
				marginLeft = '-' + Math.floor( gap )+ 'px';
			} else {
				marginLeft = '';
			}

			this.tabs[ i ].element.css( 'margin-left', marginLeft );
		}

		if( this.element.outerWidth() < this.tabs[ 0 ].element.outerWidth() ) {
			this.element.css( 'overflow', 'hidden' );
		} else {
			this.element.css( 'overflow', 'visible' );
		}
	}
function ( ) { var availableWidth = this . element . outerWidth ( ) - this . controlsContainer . outerWidth ( ) , totalTabWidth = 0 , tabElement , i , marginLeft , gap ; for ( i = 0 ; i < this . tabs . length ; i ++ ) { tabElement = this . tabs [ i ] . element ; /*
			 * In order to show every tab's close icon, decrement the z-index from left to right
			 */ tabElement . css ( 'z-index' , this . tabs . length - i ) ; totalTabWidth += tabElement . outerWidth ( ) + parseInt ( tabElement . css ( 'margin-right' ) , 10 ) ; } gap = ( totalTabWidth - availableWidth ) / ( this . tabs . length - 1 ) for ( i = 0 ; i < this . tabs . length ; i ++ ) { /*
			 * The active tab keeps it's original width
			 */ if ( ! this . tabs [ i ] . isActive && gap > 0 ) { marginLeft = '-' + Math . floor ( gap ) + 'px' ; } else { marginLeft = '' ; } this . tabs [ i ] . element . css ( 'margin-left' , marginLeft ) ; } if ( this . element . outerWidth ( ) < this . tabs [ 0 ] . element . outerWidth ( ) ) { this . element . css ( 'overflow' , 'hidden' ) ; } else { this . element . css ( 'overflow' , 'visible' ) ; } }
Shrinks the tabs if the available space is not sufficient

@returns {void}
Shrinks the tabs if the available space is not sufficient