Skip to content

Commit

Permalink
Button now stores created node
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowFish085 committed Apr 26, 2020
1 parent c48a613 commit fe802a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/content-scripts/web-integration/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export default class Button {
/** AniList data record */
entry: ALSearch.AniList.Data | null;

/** Button node. */
button: HTMLElement | null;

constructor(
fixed: boolean,
position: ButtonPosition,
Expand All @@ -39,6 +42,7 @@ export default class Button {
this.value = value;
this.title = title;
this.entry = null;
this.button = null;
}

/**
Expand Down Expand Up @@ -428,7 +432,9 @@ export default class Button {
// Try to find AniList related entry.
this.entry = await this.findEntry();

// Create button.
return this.getButtonNode();
// Create button and return it.
this.button = this.getButtonNode();

return this.button;
}
}

0 comments on commit fe802a6

Please sign in to comment.