Fix TypeScript error

It looks like TypeScript recently updated jQuery definitions from
`HTMLElement` to `Element`. There's probably a better long-term
solution, but for now, suffice to say these assertions are safe because
we don't use any non-HTML elements.
This commit is contained in:
Guangcong Luo 2020-04-27 23:44:07 -07:00
parent 14689a63ad
commit ba52aab0ef
2 changed files with 3 additions and 3 deletions

View File

@ -244,7 +244,7 @@ class BattleScene {
this.updateBgm();
if (this.battle.resumeButton) {
this.$frame.append('<div class="playbutton"><button data-action="resume"><i class="fa fa-play icon-play"></i> Resume</button></div>');
this.$frame.find('div.playbutton button').click(this.battle.resumeButton);
this.$frame.find<HTMLElement>('div.playbutton button').click(this.battle.resumeButton);
}
}
resume() {

View File

@ -257,11 +257,11 @@ class BattlePanel extends PSRoomPanel<BattleRoom> {
};
componentDidMount() {
const $elem = $(this.base!);
const battle = new Battle($elem.find('.battle'), $elem.find('.battle-log'));
const battle = new Battle($elem.find<HTMLElement>('.battle'), $elem.find<HTMLElement>('.battle-log'));
this.props.room.battle = battle;
battle.endCallback = () => this.forceUpdate();
battle.play();
(battle.scene as BattleScene).tooltips.listen($elem.find('.battle-controls'));
(battle.scene as BattleScene).tooltips.listen($elem.find<HTMLElement>('.battle-controls'));
super.componentDidMount();
}
receiveLine(args: Args) {