import {MDCDataTable} from '@material/data-table'; const dataTable = new MDCDataTable(document.querySelector('.mdc-data-table')); $(document).ready(function() { // INDEX // $(function () { $('[data-toggle="tooltip"]').tooltip(); }); $('#modal-course-syllabus').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); var courseID = button.data('course-id'); $(this).find('#modal-course-syllabus-form').attr('action', `/course/${courseID}`); }); $('#modal-course-edit').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); var courseID = button.data('course-id'); $(this).find('#modal-course-edit-form').attr('action', `/course/${courseID}`); }); $('#modal-section-create').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); var courseID = button.data('course-id'); var semCode = button.data('semester-code'); $(this).find('#modal-section-create-course_id').val(courseID); $(this).find('#modal-section-create-semester_code').val(semCode); }); // SHOW // $('#modal-section-edit').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); var sectionID = button.data('section-id'); $(this).find('#modal-section-edit-form').attr('action', `/section/${sectionID}`); }); $('#modal-section-syllabus').on('show.bs.modal', function (event) { var button = $(event.relatedTarget); var sectionID = button.data('section-id'); $(this).find('#modal-section-syllabus-form').attr('action', `/section/${sectionID}`); }); });