Loop through each section and calculate/cache it's current height.
An optional callback can be defined that will be used for height calculation.

@param {Function} [callback]
176955
function(callback) {
        if ($.type(callback) !== 'function') {
            callback = function(section) {
                return section.outerHeight();
            };
        }

        this.sections.each(function() {
            var self = $(this),
                className = self.hasClass('hide') ? 'hide' : 'show',
                maxHeight = self.css('max-height');

            // Make section visible
            self.addClass('no-transition').removeClass(className).css('max-height', '');

            // Get the height
            var height = callback.call(this, self);

            // Set section back to previous state
            self.addClass(className).css('max-height', maxHeight).removeClass('no-transition');

            // Set the height
            self.data('accordion-height', height);

            if (self.hasClass('show')) {
                self.css('max-height', height);
            }
        });
    }
1341172
function (callback, context) {
        var _children = this._children;
        for(var i = 0, len = _children.length; i < len; i++) {
            var child = _children[i];
            callback.call(context, child, i);
        }
    }
1021763
function (depth) {
        var height = 0;
        this.depth = depth;
        for (var i = 0; i < this.children.length; i++) {
            var child = this.children[i];
            child.updateDepthAndHeight(depth + 1);
            if (child.height > height) {
                height = child.height;
            }
        }
        this.height = height + 1;
    }
89931
function() {
		var i,
			sizeData = this._calculateAbsoluteSizes();

		for( i = 0; i < this.contentItems.length; i++ ) {
			if( sizeData.additionalPixel - i > 0 ) {
				sizeData.itemSizes[ i ]++;
			}

			if( this._isColumn ) {
				this.contentItems[ i ].element.width( sizeData.totalWidth );
				this.contentItems[ i ].element.height( sizeData.itemSizes[ i ] );
			} else {
				this.contentItems[ i ].element.width( sizeData.itemSizes[ i ] );
				this.contentItems[ i ].element.height( sizeData.totalHeight );
			}
		}
	}
630822
function( width, height ) {
		if( arguments.length === 2 ) {
			this.width = width;
			this.height = height;
		} else {
			this.width = this.container.width();
			this.height = this.container.height();
		}

		if( this.isInitialised === true ) {
			this.root.callDownwards( 'setSize', [ this.width, this.height ] );

			if( this._maximisedItem ) {
				this._maximisedItem.element.width( this.container.width() );
				this._maximisedItem.element.height( this.container.height() );
				this._maximisedItem.callDownwards( 'setSize' );
			}

			this._adjustColumnsResponsive();
		}
	}
796749
function fixContainerSizeNow() {
               if( !showContent || !scope.isVisible ) { return; }
               let contentHeight = 0;
               jqElement.children().each( ( index, child ) => {
                  contentHeight += $( child ).outerHeight( true );
               } );
               if( contentHeight !== currentTargetHeight ) {
                  animateToHeight( jqElement, contentHeight );
                  // if this widget contains another animated widget (such as another AxShowHideWidget),
                  // make sure to pick up on its animated content
                  $window.setTimeout( fixContainerSize, RESIZE_DELAY );
               }
            }
1162951
function(width, height) {
    if (width === this._width && height === this._height) {
      return;
    }
    this._resize = true;
    this._width = width;
    this._height = height;
  }
353262
function animateToHeight( jqElement, newHeight ) {
               currentTargetHeight = newHeight;
               startWatchingForContentResizing();
               if( newHeight > 0 ) {
                  jqElement.css( 'display', 'block' );
                  jqElement.animate( { 'height': `${newHeight}px` }, () => {
                     jqElement.css( 'height', 'auto' );
                     stopWatchingForContentResizing();
                  } );
               }
               else {
                  jqElement.animate( { 'height': 0 }, () => {
                     if( !showContent ) {
                        jqElement.css( 'display', 'none' );
                     }
                  } );
               }
            }
95719
function allocate(height, length) {
	var node = new Array(length);
	node.height = height;
	if (height > 0) {
		node.sizes = new Array(length);
	}
	return node;
}
1180994
function( width, height ){

            if ( width === undefined && height === undefined ){
                width = this.container.offsetWidth;
                height = this.container.offsetHeight;
            }

            this.width = width || 0;
            this.height = height || 0;
            // should be implemented in renderers
        }
835752
function() {
        var dimensionModel, height;

        if (this.$scrollBorder) {
            dimensionModel = this.dimensionModel;
            height = dimensionModel.get('bodyHeight') - dimensionModel.getScrollXHeight();
            this.$scrollBorder.height(height);
        }
    }
387654
function getClearedHeight(e) {
                    var height = e.height();

                    e.children().each(function () {
                        height = Math.max(height, $(this).height());
                    });

                    return height;
                }
733971
function $domElements(c, callback) {
                for (var k in c.$domKids) {
                    var e = c.$domKids[k];
                    if (e.isDOMElement === true) {
                        callback.call(this, e);
                    } else if (e.$domKids !== undefined) { // prevent unnecessary method call by condition
                        $domElements(e, callback);
                    }
                }
            }
952055
function setHeight(height) {
		viewHeight = height;
		
		var bodyHeight = viewHeight - head.height();
		var rowHeight;
		var rowHeightLast;
		var cell;
			
		if (opt('weekMode') == 'variable') {
			rowHeight = rowHeightLast = Math.floor(bodyHeight / (rowCnt==1 ? 2 : 6));
		}else{
			rowHeight = Math.floor(bodyHeight / rowCnt);
			rowHeightLast = bodyHeight - rowHeight * (rowCnt-1);
		}
		
		bodyFirstCells.each(function(i, _cell) {
			if (i < rowCnt) {
				cell = $(_cell);
				cell.find('> div').css(
					'min-height',
					(i==rowCnt-1 ? rowHeightLast : rowHeight) - vsides(cell)
				);
			}
		});
		
	}
236276
function() {
    // Calculate new column count after resize.
    columnCount = getColumnCount();
    if(columnHeights.length != columnCount) {
      // Reset array of column heights and container width.
      resetHeights(columnCount);
      adjustCells(cellsContainer.children, true);
    } else {
      manageCells();
    }
  }
1094706
function setVerticals(segments, doRowHeights) {
		var rowContentHeights = calculateVerticals(segments); // also sets segment.top
		var rowContentElements = getRowContentElements(); // returns 1 inner div per row
		var rowContentTops = [];

		// Set each row's height by setting height of first inner div
		if (doRowHeights) {
			for (var i=0; i<rowContentElements.length; i++) {
				rowContentElements[i].height(rowContentHeights[i]);
			}
		}

		// Get each row's top, relative to the views's origin.
		// Important to do this after setting each row's height.
		for (var i=0; i<rowContentElements.length; i++) {
			rowContentTops.push(
				rowContentElements[i].position().top
			);
		}

		// Set each segment element's CSS "top" property.
		// Each segment object has a "top" property, which is relative to the row's top, but...
		segmentElementEach(segments, function(segment, element) {
			element.css(
				'top',
				rowContentTops[segment.row] + segment.top // ...now, relative to views's origin
			);
		});
	}
838364
function(element, args) {
        if(!args)
            args = {};
        var refreshDelay = args.refreshDelay ? args.refreshDelay : 500;
        var previousHeight = args.previousHeight;
        var level = args.level ? args.level : 0;
        var ret = new $.Deferred();
        var elmHeight;

        if(element)
            elmHeight = element[0].getBoundingClientRect().height;

        if(elmHeight && (!previousHeight || previousHeight != elmHeight)) {
            ret.resolve(elmHeight, previousHeight, level);
        } else {
            args.previousHeight = elmHeight;
            setTimeout(function () {
                resolveElementHeightChange(element, {previousHeight: elmHeight, refreshDelay: refreshDelay, level: (level + 1)}).then(function(newHeightVal, previousHeightVal, levelVal) {
                    ret.resolve(newHeightVal, previousHeightVal, level);
                });
            }, refreshDelay);
        }

        return ret;
    }