Closes #390 - Put a check in to see if the gridmap has a length greater then zero

This commit is contained in:
Chris Cowan 2014-09-29 10:25:57 -07:00
parent 6381eb6247
commit 3077ace5b4

View file

@ -190,7 +190,10 @@ define(function (require) {
g.generate_stylesheet({ namespace: '.gridster' });
g.get_widgets_from_DOM();
g.set_dom_grid_height();
// We can't call this method if the gridmap is empty. This was found
// when the user double clicked the "New Dashboard" icon. See
// https://github.com/elasticsearch/kibana4/issues/390
if (gridster.gridmap.length > 0) g.set_dom_grid_height();
g.drag_api.set_limits(COLS * g.min_widget_width);
};
@ -200,6 +203,7 @@ define(function (require) {
readGridsterChangeHandler();
complete();
};
var safeLayout = _.debounce(layout, 200);
init();
@ -207,4 +211,4 @@ define(function (require) {
};
});
});
});