Skip to content

Commit

Permalink
add a disconnect method to opening_times_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaargZombies committed Aug 30, 2022
1 parent 0953fde commit 24e6a33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/javascript/controllers/opening_times_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export default class extends Controller {
this.resetForm();
}

disconnect() {
// clear nodes & eventListeners which don't have stimulus attributes
// This might be unnecessary
this.listTarget.replaceChildren();
}

resetForm(day = "Monday", open = "00:00", close = "00:00") {
const allDay = open === "00:00" && close === "23:59";
this.dayTarget.value = day;
Expand Down

0 comments on commit 24e6a33

Please sign in to comment.