1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 21:29:38 +02:00
Maybe/app/javascript/controllers/transfer_match_controller.js

17 lines
500 B
JavaScript
Raw Normal View History

import { Controller } from "@hotwired/stimulus";
// Connects to data-controller="transfer-match"
export default class extends Controller {
static targets = ["newSelect", "existingSelect"];
update(event) {
if (event.target.value === "new") {
this.newSelectTarget.classList.remove("hidden");
this.existingSelectTarget.classList.add("hidden");
} else {
this.newSelectTarget.classList.add("hidden");
this.existingSelectTarget.classList.remove("hidden");
}
}
}