You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.7 KiB
68 lines
1.7 KiB
// 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. |
|
|
|
import Rails from "@rails/ujs" |
|
import Turbolinks from "turbolinks" |
|
import * as ActiveStorage from "@rails/activestorage" |
|
import "channels" |
|
|
|
import '../src/application.scss' |
|
|
|
import 'bootstrap'; |
|
import 'bootstrap/dist/css/bootstrap.min.css'; |
|
import "@fortawesome/fontawesome-free/js/all.min"; |
|
import "@fortawesome/fontawesome-free/css/all.min"; |
|
import "moment"; |
|
import "select2"; |
|
import "chosen-js"; |
|
import 'trix/dist/trix.css'; |
|
import 'trix/dist/trix.js'; |
|
import "cable_ready"; |
|
|
|
window.jQuery = $; |
|
window.$ = $; |
|
|
|
Rails.start() |
|
Turbolinks.start() |
|
ActiveStorage.start() |
|
|
|
$(document).on("ready turbolinks:load", function () { |
|
$('#toggleSideNav').on('click', function () { |
|
$('#sidenav').toggleClass('active'); |
|
}); |
|
|
|
$(".clickable-link").on("click", function (e) { |
|
e.preventDefault(); |
|
|
|
let $href = $(this).attr("href"); |
|
if ($href !== undefined) { |
|
window.location.href = $href; |
|
} |
|
}); |
|
|
|
$(".clickable-tr").on("click", function () { |
|
let $href = $(this).attr("href"); |
|
console.log("$href") |
|
if ($href !== undefined) { |
|
window.open($href); |
|
} |
|
}) |
|
|
|
var default_opts = { |
|
plugins: ['restore_on_backspace', 'remove_button'], |
|
searchField: ['text', 'optgroup'], |
|
valueField: "id", |
|
allowEmptyOption: false, |
|
showEmptyOptionInDropdown: true, |
|
emptyOptionLabel: true, |
|
hideSelected: true, |
|
placeholder: "Please Select" |
|
} |
|
|
|
$(".default-selectize").selectize(default_opts) |
|
}); |
|
|
|
import "channels" |
|
import "controllers"
|
|
|