diff --git a/package.json b/package.json index 3bd236e..e13f68a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doomsday", - "version": "1.5.0", + "version": "1.5.1", "description": "Test your mastery of Conway's Doomsday rule.", "author": "Florine W. Dekker", "browser": "dist/bundle.js", diff --git a/src/main/js/Main.ts b/src/main/js/Main.ts index e29cd2e..53299d7 100644 --- a/src/main/js/Main.ts +++ b/src/main/js/Main.ts @@ -347,6 +347,8 @@ doAfterLoad(() => { onToggle(isOpened: boolean): void { super.onToggle(isOpened); if (isOpened) centuryInput.selectInput(); + else if (yearDetails.isOpened()) yearInput.selectInput(); + else if (dayDetails.isOpened()) dayInput.selectInput(); centuryInput.updateTitle(); } }("century", $("#century-details")); @@ -354,6 +356,8 @@ doAfterLoad(() => { onToggle(isOpened: boolean): void { super.onToggle(isOpened); if (isOpened) yearInput.selectInput(); + else if (dayDetails.isOpened()) dayInput.selectInput(); + else if (centuryDetails.isOpened()) centuryInput.selectInput(); yearInput.updateTitle(); } }("year", $("#year-details")); @@ -361,6 +365,8 @@ doAfterLoad(() => { onToggle(isOpened: boolean): void { super.onToggle(isOpened); if (isOpened) dayInput.selectInput(); + else if (centuryDetails.isOpened()) centuryInput.selectInput(); + else if (yearDetails.isOpened()) yearInput.selectInput(); dayInput.updateTitle(); } }("day", $("#day-details")); @@ -384,10 +390,6 @@ doAfterLoad(() => { resetButton.focus(); } - onInvalidInput() { - // Do nothing - } - updateTitle() { if (centuryDetails.isOpened()) this.titleLabel.innerText = `Anchor day of century starting in ${quizDate.getCentury() * 100}?`; @@ -412,10 +414,6 @@ doAfterLoad(() => { resetButton.focus(); } - onInvalidInput() { - // Do nothing - } - updateTitle() { if (yearDetails.isOpened()) this.titleLabel.innerText = `Doomsday of year ${quizDate.date.year}?`; @@ -437,10 +435,6 @@ doAfterLoad(() => { resetButton.focus(); } - onInvalidInput() { - // Do nothing - } - updateTitle() { if (dayDetails.isOpened()) this.titleLabel.innerText = `Weekday of ${quizDate.date.toISODate()}?`;