1
0
postdoc/app/javascript/controllers/alert_controller.js
2020-12-06 21:05:11 +01:00

27 lines
518 B
JavaScript

// Visit The Stimulus Handbook for more details
// https://stimulusjs.org/handbook/introduction
//
// This example controller works with specially annotated HTML like:
//
// <div data-controller="hello">
// <h1 data-target="hello.output"></h1>
// </div>
import { Controller } from "stimulus"
export default class extends Controller {
static targets = [ "alert" ]
connect() {
}
close(event) {
event.preventDefault();
this.removeAlert();
}
removeAlert() {
this.alertTarget.remove();
}
}