Replaced the JavaScript prefix attributes that are only used in the class constructors with the prefix constant variables in the constructor.

This commit is contained in:
2023-03-23 07:06:58 +08:00
parent 52807c5322
commit 7ed13dc0af
3 changed files with 32 additions and 56 deletions

View File

@ -33,12 +33,6 @@ document.addEventListener("DOMContentLoaded", () => {
*/
class PeriodChooser {
/**
* The prefix of the HTML ID and class
* @type {string}
*/
prefix;
/**
* The modal of the period chooser
* @type {HTMLDivElement}
@ -56,8 +50,8 @@ class PeriodChooser {
*
*/
constructor() {
this.prefix = "accounting-period-chooser";
this.modal = document.getElementById(this.prefix + "-modal");
const prefix = "accounting-period-chooser";
this.modal = document.getElementById(prefix + "-modal");
for (const cls of [MonthTab, YearTab, DayTab, CustomTab]) {
const tab = new cls(this);
this.tabPlanes[tab.tabId()] = tab;