Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
feat(#471): update chart after load in popover selection
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Nov 22, 2019
1 parent 4632925 commit 2f5fd8e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class AppCreateSlide {
async componentDidLoad() {
await this.lazyLoadContent();
await this.drawChart();
await this.updatePollChart();
}

componentDidUnload() {
Expand Down Expand Up @@ -109,11 +110,26 @@ export class AppCreateSlide {
});
}

private updatePollChart(): Promise<void> {
return new Promise<void>(async (resolve) => {
const slidePoll: HTMLElement = this.el.querySelector('deckgo-slide-poll.showcase');

if (!slidePoll) {
resolve();
return;
}

await (slidePoll as any).update();

resolve();
});
}

private async addSlide(template: SlideTemplate, deck?: Deck) {
const slide: JSX.IntrinsicElements = await CreateSlidesUtils.createSlide(template, false, deck, this.user);
await this.closePopover(template, slide);
}

private async addSlideSplit(template: SlideTemplate, attributes: SlideAttributes = undefined) {
const slide: JSX.IntrinsicElements = await CreateSlidesUtils.createSlideSplit(attributes);
await this.closePopover(template, slide);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ export class DeckdeckgoSlidePoll implements DeckdeckgoSlideResize {
return;
}

await this.initChartSize();

this.chartData = await this.initChartData();

this.chartData = this.chartData ? [...this.chartData] : undefined;
Expand Down

0 comments on commit 2f5fd8e

Please sign in to comment.