-
Notifications
You must be signed in to change notification settings - Fork 1
/
application.js
27 lines (23 loc) · 981 Bytes
/
application.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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"
// Provides @mention functionality in textboxes (adds to jQuery UI autocomplete)
import "./vendor/jquery-ui-triggeredAutocomplete"
import WorkForm from "./works/form"
if (typeof(window._rails_loaded) == "undefined" || window._rails_loaded == null || !window._rails_loaded) {
Rails.start()
}
Turbolinks.start()
ActiveStorage.start()
$(document).ready( (event) => {
$(".work-form").each( (index, element) => {
const $element = $(element);
const work = $element.data('work');
const workForm = new WorkForm($element, work);
});
});