From 55f370f0021a77dabf455acd1d658fda542ebd96 Mon Sep 17 00:00:00 2001 From: Sebastian Weyrauch Date: Sun, 22 Mar 2020 19:57:54 +0100 Subject: [PATCH] add handling for no active columns --- colcade.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/colcade.js b/colcade.js index 67261ad..59091df 100644 --- a/colcade.js +++ b/colcade.js @@ -132,6 +132,11 @@ proto.layoutItems = function( items ) { }; proto.layoutItem = function( item ) { + // skip if no column is active + if (!this.activeColumns.length) { + return; + } + // layout item by appending to column var minHeight = Math.min.apply( Math, this.columnHeights ); var index = this.columnHeights.indexOf( minHeight );