mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
22 lines
458 B
JavaScript
22 lines
458 B
JavaScript
import { Controller } from "stimulus";
|
|
|
|
export default class extends Controller {
|
|
static targets = ["stripeelements", "select"];
|
|
|
|
connect() {
|
|
this.selectCard(this.selectTarget.value);
|
|
}
|
|
|
|
onSelectCard(event) {
|
|
this.selectCard(event.target.value);
|
|
}
|
|
|
|
selectCard(cardValue) {
|
|
if (cardValue == "") {
|
|
this.stripeelementsTarget.style.display = "block";
|
|
} else {
|
|
this.stripeelementsTarget.style.display = "none";
|
|
}
|
|
}
|
|
}
|