INNER CODE UNIT · JavaScript
extends
tramlinehq/tramline · app/javascript/controllers/activation_controller.js:3
export default class extends Controller {
static targets = ["target"]
static values = {
active: String,
inactive: String
}
toggle(event) {
this.targetTargets.forEach(t => {
if (t === event.target) {
t.className = this.activeValue;
} else {
t.className = this.inactiveValue;
}
});
}
}