Cleanup
This commit is contained in:
12
app/javascript/contact_us_form.js
Normal file
12
app/javascript/contact_us_form.js
Normal file
@@ -0,0 +1,12 @@
|
||||
document.addEventListener("turbolinks:load", function () {
|
||||
var form = document.getElementById('contact-us-form');
|
||||
form.addEventListener('submit', function (e) {
|
||||
document.getElementById("contact-us-form-submit-button").classList.add('is-hidden');
|
||||
document.getElementById("contact-us-form-loading-state").classList.remove('is-hidden');
|
||||
});
|
||||
|
||||
form.addEventListener('tinyforms:submitted', function(e) {
|
||||
form.classList.add('is-hidden');
|
||||
document.getElementById("contact-us-form-success-message").classList.remove('is-hidden');
|
||||
})
|
||||
});
|
||||
@@ -14,6 +14,7 @@ require('demo');
|
||||
require('backend_typed');
|
||||
require('tabs');
|
||||
require('prism');
|
||||
require('contact_us_form');
|
||||
|
||||
// Uncomment to copy all static images under ../images to the output folder and reference
|
||||
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
|
||||
|
||||
Reference in New Issue
Block a user