Revert "src: Simplify HintState constructor"

This reverts commit 092e501db4.

This was causing a bug identified by @glacambre and @Lexi where
sometimes the html function isn't defined when returning to a page with
history back.

Personally, I think it's probably webpack or Firefox's fault: content.ts
clearly imports html-tagged-template as it's first action.

If it's not their fault then it's html-tagged-template's fault: it must
be refusing to set window.html.
This commit is contained in:
Colin Caine 2018-03-05 23:06:18 +00:00
parent 8d6a79ca50
commit 7ea938f74f

View file

@ -25,12 +25,16 @@ const logger = new Logger('hinting')
/** Simple container for the state of a single frame's hints. */
class HintState {
public focusedHint: Hint
readonly hintHost = html`<div class="TridactylHintHost cleanslate">`
readonly hintHost = document.createElement('div')
readonly hints: Hint[] = []
public filter = ''
public hintchars = ''
constructor(public filterFunc: HintFilter) {}
constructor(
public filterFunc: HintFilter,
){
this.hintHost.classList.add("TridactylHintHost", "cleanslate")
}
destructor() {
// Undo any alterations of the hinted elements