Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This file is automatically compiled by Webpack, along with any other files
- // present in this directory. You're encouraged to place your actual application logic in
- // a relevant structure within app/javascript and only use these pack files to reference
- // that code so it'll be compiled.
- require("@rails/ujs").start();
- require("@rails/activestorage").start();
- require("channels");
- require("scripts/toggle_elements");
- require("scripts/add_tag");
- // 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' %>)
- // or the `imagePath` JavaScript helper below.
- //
- // const images = require.context('../images', true)
- // const imagePath = (name) => images(name, true)
- import jquery from "jquery";
- window.$ = window.jquery = jquery; //force-load jquery before bootstrap
- import "bootstrap";
- import "cocoon-js";
- import "../stylesheets/application";
- import "@fortawesome/fontawesome-free/js/all";
- import "@fortawesome/fontawesome-free/css/all.css";
- import "../scripts/employees";
- document.addEventListener("ajax:success", () => {
- let checkbox = document.querySelector(".checkbox-toggler");
- if (checkbox) {
- fieldsToggler();
- checkbox.addEventListener("click", () => {
- fieldsToggler();
- });
- }
- function fieldsToggler() {
- let element = document.querySelector(".toggle-field");
- if (checkbox && checkbox.checked) {
- element.style["display"] = "none";
- } else {
- element.style["display"] = "block";
- }
- }
- });
- // Support component names relative to this directory:
- var componentRequireContext = require.context("components", true);
- var ReactRailsUJS = require("react_ujs");
- ReactRailsUJS.useContext(componentRequireContext);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement