Skip to content

Commit 3077ace

Browse files
committed
Closes #390 - Put a check in to see if the gridmap has a length greater then zero
1 parent 6381eb6 commit 3077ace

File tree

1 file changed

+6
-2
lines changed
  • src/kibana/apps/dashboard/directives

1 file changed

+6
-2
lines changed

src/kibana/apps/dashboard/directives/grid.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ define(function (require) {
190190
g.generate_stylesheet({ namespace: '.gridster' });
191191

192192
g.get_widgets_from_DOM();
193-
g.set_dom_grid_height();
193+
// We can't call this method if the gridmap is empty. This was found
194+
// when the user double clicked the "New Dashboard" icon. See
195+
// https://github.com/elasticsearch/kibana4/issues/390
196+
if (gridster.gridmap.length > 0) g.set_dom_grid_height();
194197
g.drag_api.set_limits(COLS * g.min_widget_width);
195198
};
196199

@@ -200,11 +203,12 @@ define(function (require) {
200203
readGridsterChangeHandler();
201204
complete();
202205
};
206+
203207
var safeLayout = _.debounce(layout, 200);
204208

205209
init();
206210
}
207211
};
208212
});
209213

210-
});
214+
});

0 commit comments

Comments
 (0)