Skip to content

Commit

Permalink
Closes #390 - Put a check in to see if the gridmap has a length great…
Browse files Browse the repository at this point in the history
…er then zero
  • Loading branch information
simianhacker committed Sep 29, 2014
1 parent 6381eb6 commit 3077ace
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/kibana/apps/dashboard/directives/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand All @@ -200,11 +203,12 @@ define(function (require) {
readGridsterChangeHandler();
complete();
};

var safeLayout = _.debounce(layout, 200);

init();
}
};
});

});
});

0 comments on commit 3077ace

Please sign in to comment.