fosterful/scheduler

View on GitHub
app/javascript/controllers/dashboard_query_controller.js

Summary

Maintainability
A
1 hr
Test Coverage
import { Controller } from "stimulus"
 
export default class extends Controller {
static targets = [ "hideableHours", "hideableNeeds" ]
 
Similar blocks of code found in 2 locations. Consider refactoring.
toggleHoursTargets() {
this.hideableHoursTargets.forEach((el) => {
el.hidden = !el.hidden
});
}
 
Similar blocks of code found in 2 locations. Consider refactoring.
toggleNeedsTargets() {
this.hideableNeedsTargets.forEach((el) => {
el.hidden = !el.hidden
});
}
 
hideHoursTargets() {
this.hideableHoursTargets.forEach((el) => {
el.hidden = true
});
}
 
hideNeedsTargets() {
this.hideableNeedsTargets.forEach((el) => {
el.hidden = true
});
}
}