Form to create airtable and google sheets forms

This commit is contained in:
2020-04-25 22:58:03 +02:00
parent 60386cb51e
commit 833de45827
6 changed files with 108 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ require('burger_menu');
require('tinyforms');
require('demo');
require('backend_typed');
require('tabs');
// 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' %>)

16
app/javascript/tabs.js Normal file
View File

@@ -0,0 +1,16 @@
document.addEventListener("turbolinks:load", function () {
const tabLinks = document.querySelectorAll('.tabs a[data-target]');
tabLinks.forEach(el => {
el.addEventListener('click', (e) => {
e.preventDefault();
// hide alll
tabLinks.forEach(link => {
link.closest('li').classList.remove('is-active');
document.getElementById(link.dataset.target).classList.add('is-hidden')
});
const target = document.getElementById(el.dataset.target);
target.classList.remove('is-hidden');
el.closest('li').classList.add('is-active');
}, true);
});
});