Skip to content

Commit

Permalink
make sure autoresize class is set correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Apr 27, 2022
1 parent d83888e commit 89b2022
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/plugins/vis_types/vega/public/vega_view/vega_base_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ export class VegaBaseView {
this._initialized = true;

try {
if (this._parser.useResize) {
this._$parentEl.addClass('vgaVis--autoresize');
} else {
this._$parentEl.removeClass('vgaVis--autoresize');
}
this._$parentEl.empty().addClass(`vgaVis`).css('flex-direction', this._parser.containerDir);

// bypass the onWarn warning checks - in some cases warnings may still need to be shown despite being disabled
Expand Down Expand Up @@ -260,13 +265,6 @@ export class VegaBaseView {
}

async resize() {
if (this._$parentEl) {
if (this._parser.useResize) {
this._$parentEl.addClass('vgaVis--autoresize');
} else {
this._$parentEl.removeClass('vgaVis--autoresize');
}
}
if (this._parser.useResize && this._view) {
this.updateVegaSize(this._view);
await this._view.runAsync();
Expand Down

0 comments on commit 89b2022

Please sign in to comment.