- square date
- fixed typos - missed mCss inits
This commit is contained in:
@@ -1,34 +1,3 @@
|
||||
function initSelects() {
|
||||
var selectElements = document.querySelectorAll('select');
|
||||
var selectInstances = M.FormSelect.init(selectElements, {});
|
||||
|
||||
}
|
||||
|
||||
function initSidenav() {
|
||||
var sidenavElements = document.querySelectorAll('.sidenav');
|
||||
var sidenavInstances = M.Sidenav.init(sidenavElements, {});
|
||||
};
|
||||
|
||||
function initModals() {
|
||||
var modalElements = document.querySelectorAll('.modal');
|
||||
var modalInstances = M.Modal.init(modalElements, {
|
||||
'onOpenEnd': initSelects
|
||||
});
|
||||
};
|
||||
|
||||
function openEventModal(eventId) {
|
||||
openModal(`#event-modal-${eventId}`);
|
||||
}
|
||||
|
||||
function openModal(modalId) {
|
||||
var modalElement = document.querySelector(modalId);
|
||||
if (modalElement === null) {
|
||||
return;
|
||||
}
|
||||
var modalInstance = M.Modal.getInstance(modalElement);
|
||||
modalInstance.open();
|
||||
}
|
||||
|
||||
// What to do when the document is loaded.
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// init materialize elements
|
||||
@@ -42,3 +11,43 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
openEventModal(eventId);
|
||||
}
|
||||
});
|
||||
|
||||
// Inits for MaterializeCss (mCss) elements
|
||||
|
||||
// Init select forms
|
||||
function initSelects() {
|
||||
var selectElements = document.querySelectorAll('select');
|
||||
// var selectInstances =
|
||||
M.FormSelect.init(selectElements, {});
|
||||
}
|
||||
|
||||
// Init SideNav menu
|
||||
function initSidenav() {
|
||||
var sidenavElements = document.querySelectorAll('.sidenav');
|
||||
// var sidenavInstances =
|
||||
M.Sidenav.init(sidenavElements, {});
|
||||
};
|
||||
|
||||
// Init Modals
|
||||
function initModals() {
|
||||
var modalElements = document.querySelectorAll('.modal');
|
||||
// var modalInstances =
|
||||
M.Modal.init(modalElements, {
|
||||
'onOpenEnd': initSelects
|
||||
});
|
||||
};
|
||||
|
||||
// Open the modal of an event by event Id
|
||||
function openEventModal(eventId) {
|
||||
openModal(`#event-modal-${eventId}`);
|
||||
}
|
||||
|
||||
// Open a modal by html-Id
|
||||
function openModal(modalId) {
|
||||
var modalElement = document.querySelector(modalId);
|
||||
if (modalElement === null) {
|
||||
return;
|
||||
}
|
||||
var modalInstance = M.Modal.getInstance(modalElement);
|
||||
modalInstance.open();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user