src/js/items/RowOrColumn.js
function( contentItem, index, _$suspendResize ) {

		var newItemSize, itemSize, i, splitterElement;

		contentItem = this.layoutManager._$normalizeContentItem( contentItem, this );

		if( index === undefined ) {
			index = this.contentItems.length;
		}

		if( this.contentItems.length > 0 ) {
			splitterElement = this._createSplitter( Math.max( 0, index - 1 ) ).element;

			if( index > 0 ) {
				this.contentItems[ index - 1 ].element.after( splitterElement );
				splitterElement.after( contentItem.element );
				if ( this._isDocked( index - 1 ) ) {
					this._splitter[ index - 1 ].element.hide();
					this._splitter[ index ].element.show();
				}
			} else {
				this.contentItems[ 0 ].element.before( splitterElement );
				splitterElement.before( contentItem.element );
			}
		} else {
			this.childElementContainer.append( contentItem.element );
		}

		lm.items.AbstractContentItem.prototype.addChild.call( this, contentItem, index );

		newItemSize = ( 1 / this.contentItems.length ) * 100;

		if( _$suspendResize === true ) {
			this.emitBubblingEvent( 'stateChanged' );
			return;
		}

		for( i = 0; i < this.contentItems.length; i++ ) {
			if( this.contentItems[ i ] === contentItem ) {
				contentItem.config[ this._dimension ] = newItemSize;
			} else {
				itemSize = this.contentItems[ i ].config[ this._dimension ] *= ( 100 - newItemSize ) / 100;
				this.contentItems[ i ].config[ this._dimension ] = itemSize;
			}
		}

		this.callDownwards( 'setSize' );
		this.emitBubblingEvent( 'stateChanged' );
		this._validateDocking();
	}
function( contentItem, index, _$suspendResize ) {

		var newItemSize, itemSize, i, splitterElement;

		contentItem = this.layoutManager._$normalizeContentItem( contentItem, this );

		if( index === undefined ) {
			index = this.contentItems.length;
		}

		if( this.contentItems.length > 0 ) {
			splitterElement = this._createSplitter( Math.max( 0, index - 1 ) ).element;

			if( index > 0 ) {
				this.contentItems[ index - 1 ].element.after( splitterElement );
				splitterElement.after( contentItem.element );
				if ( this._isDocked( index - 1 ) ) {
					this._splitter[ index - 1 ].element.hide();
					this._splitter[ index ].element.show();
				}
			} else {
				this.contentItems[ 0 ].element.before( splitterElement );
				splitterElement.before( contentItem.element );
			}
		} else {
			this.childElementContainer.append( contentItem.element );
		}

		lm.items.AbstractContentItem.prototype.addChild.call( this, contentItem, index );

		newItemSize = ( 1 / this.contentItems.length ) * 100;

		if( _$suspendResize === true ) {
			this.emitBubblingEvent( 'stateChanged' );
			return;
		}

		for( i = 0; i < this.contentItems.length; i++ ) {
			if( this.contentItems[ i ] === contentItem ) {
				contentItem.config[ this._dimension ] = newItemSize;
			} else {
				itemSize = this.contentItems[ i ].config[ this._dimension ] *= ( 100 - newItemSize ) / 100;
				this.contentItems[ i ].config[ this._dimension ] = itemSize;
			}
		}

		this.callDownwards( 'setSize' );
		this.emitBubblingEvent( 'stateChanged' );
		this._validateDocking();
	}
function ( contentItem , index , _$suspendResize ) { var newItemSize , itemSize , i , splitterElement ; contentItem = this . layoutManager . _$normalizeContentItem ( contentItem , this ) ; if ( index === undefined ) { index = this . contentItems . length ; } if ( this . contentItems . length > 0 ) { splitterElement = this . _createSplitter ( Math . max ( 0 , index - 1 ) ) . element ; if ( index > 0 ) { this . contentItems [ index - 1 ] . element . after ( splitterElement ) ; splitterElement . after ( contentItem . element ) ; if ( this . _isDocked ( index - 1 ) ) { this . _splitter [ index - 1 ] . element . hide ( ) ; this . _splitter [ index ] . element . show ( ) ; } } else { this . contentItems [ 0 ] . element . before ( splitterElement ) ; splitterElement . before ( contentItem . element ) ; } } else { this . childElementContainer . append ( contentItem . element ) ; } lm . items . AbstractContentItem . prototype . addChild . call ( this , contentItem , index ) ; newItemSize = ( 1 / this . contentItems . length ) * 100 ; if ( _$suspendResize === true ) { this . emitBubblingEvent ( 'stateChanged' ) ; return ; } for ( i = 0 ; i < this . contentItems . length ; i ++ ) { if ( this . contentItems [ i ] === contentItem ) { contentItem . config [ this . _dimension ] = newItemSize ; } else { itemSize = this . contentItems [ i ] . config [ this . _dimension ] *= ( 100 - newItemSize ) / 100 ; this . contentItems [ i ] . config [ this . _dimension ] = itemSize ; } } this . callDownwards ( 'setSize' ) ; this . emitBubblingEvent ( 'stateChanged' ) ; this . _validateDocking ( ) ; }
Add a new contentItem to the Row or Column

@param {lm.item.AbstractContentItem} contentItem
@param {[int]} index The position of the new item within the Row or Column.
If no index is provided the item will be added to the end
@param {[bool]} _$suspendResize If true the items won't be resized. This will leave the item in
an inconsistent state and is only intended to be used if multiple
children need to be added in one go and resize is called afterwards

@returns {void}
Add a new contentItem to the Row or Column