// import {MDCDataTable} from '@material/data-table';
// const dataTable = new MDCDataTable(document.querySelector('.mdc-data-table'));

$(document).ready(function() {
    // $('#course-table').DataTable({
    //     paging: true,
    //     pagingType: 'simple',
    //     searching: false,
    //     scrollCollapse: false,
    //     columnDefs: [
    //         {targets: [0,1], orderable: true},
    //         {targets: '_all', orderable: false}
    //     ]

    // });
    $(function () {
        $('[data-toggle="tooltip"]').tooltip();
    });
    $('#modal-syllabus').on('show.bs.modal', function (event) {
        var button = $(event.relatedTarget);
        var courseID = button.data('course-id');
        $(this).find('#modal-syllabus-form').attr('action', `/course/${courseID}`);
    });
    $('#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}`);
    });
});

function addSection (courseID, semCode) {
    var modal = $('#modal-section-create');
    modal.modal('toggle');
    modal.find('#modal-section-create-course_id').val(courseID);
    modal.find('#modal-section-create-semester_code').val(semCode);
}