Form to create airtable and google sheets forms
This commit is contained in:
@@ -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
16
app/javascript/tabs.js
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user