Skip to content

Instantly share code, notes, and snippets.

@limscoder
Last active March 15, 2018 21:17
Show Gist options
  • Save limscoder/f29a444afe50161664d41392f7dd5499 to your computer and use it in GitHub Desktop.
Save limscoder/f29a444afe50161664d41392f7dd5499 to your computer and use it in GitHub Desktop.
link(scope, elem) {
this.elem = elem;
setTimeout(() => {
this.resizePanel();
this.renderViewBox();
}, 50);
}
resizePanel() {
// set height and width of panel
const width = this.elem.find('.panel-container')[0].offsetWidth;
this.updateHeight(width * 0.33);
}
updateHeight(height = 500) {
const rowHeight = GRID_CELL_HEIGHT + GRID_CELL_VMARGIN;
this.panel.updateGridPos({
...this.panel.gridPos,
h: Math.ceil(height / rowHeight)
});
this.dashboard.events.emit('row-expanded');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment