설명 없음

course.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import {MDCDataTable} from '@material/data-table';
  2. const dataTable = new MDCDataTable(document.querySelector('.mdc-data-table'));
  3. $(document).ready(function() {
  4. // INDEX //
  5. $(function () {
  6. $('[data-toggle="tooltip"]').tooltip();
  7. });
  8. $('#modal-course-syllabus').on('show.bs.modal', function (event) {
  9. var button = $(event.relatedTarget);
  10. var courseID = button.data('course-id');
  11. $(this).find('#modal-course-syllabus-form').attr('action', `/course/${courseID}`);
  12. });
  13. $('#modal-course-edit').on('show.bs.modal', function (event) {
  14. var button = $(event.relatedTarget);
  15. var courseID = button.data('course-id');
  16. $(this).find('#modal-course-edit-form').attr('action', `/course/${courseID}`);
  17. });
  18. $('#modal-section-create').on('show.bs.modal', function (event) {
  19. var button = $(event.relatedTarget);
  20. var courseID = button.data('course-id');
  21. var semCode = button.data('semester-code');
  22. $(this).find('#modal-section-create-course_id').val(courseID);
  23. $(this).find('#modal-section-create-semester_code').val(semCode);
  24. });
  25. // SHOW //
  26. $('#modal-section-edit').on('show.bs.modal', function (event) {
  27. var button = $(event.relatedTarget);
  28. var sectionID = button.data('section-id');
  29. $(this).find('#modal-section-edit-form').attr('action', `/section/${sectionID}`);
  30. });
  31. $('#modal-section-syllabus').on('show.bs.modal', function (event) {
  32. var button = $(event.relatedTarget);
  33. var sectionID = button.data('section-id');
  34. $(this).find('#modal-section-syllabus-form').attr('action', `/section/${sectionID}`);
  35. });
  36. });