From 341e1bbd4c035254577b5a119d3e6cdf69b533b6 Mon Sep 17 00:00:00 2001 From: vieron Date: Thu, 26 Jul 2012 09:58:39 +0200 Subject: [PATCH] prevent cols/rows from being empty arrays (needed to pass phantom tests) --- src/jquery.gridster.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 8d2fab8a16..bf6d789737 100644 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -2143,10 +2143,14 @@ var actual_cols = this.$widgets.map(function() { return $(this).attr('data-col'); }); + //needed to pass tests with phantomjs + actual_cols.length || (actual_cols = [0]); var actual_rows = this.$widgets.map(function() { return $(this).attr('data-row'); }); + //needed to pass tests with phantomjs + actual_rows.length || (actual_rows = [0]); var min_cols = Math.max.apply(Math, actual_cols); var min_rows = Math.max.apply(Math, actual_rows);