added bootstar, font awsome, and the project is in a useable state, bit needs some manual setup.
This commit is contained in:
3532
ProjectKiln/app/js/home.js
Normal file
3532
ProjectKiln/app/js/home.js
Normal file
File diff suppressed because it is too large
Load Diff
1
ProjectKiln/app/js/main.js
Normal file
1
ProjectKiln/app/js/main.js
Normal file
@@ -0,0 +1 @@
|
||||
// Reserved for shared application behavior.
|
||||
59
ProjectKiln/app/js/popups.js
Normal file
59
ProjectKiln/app/js/popups.js
Normal file
@@ -0,0 +1,59 @@
|
||||
function openPopup(name) {
|
||||
const popup = document.getElementById(name + 'Popup');
|
||||
const backdrop = document.getElementById('popupBackdrop');
|
||||
|
||||
if (!popup || !backdrop) return;
|
||||
|
||||
backdrop.hidden = false;
|
||||
popup.hidden = false;
|
||||
}
|
||||
|
||||
function closePopups() {
|
||||
document.querySelectorAll('.kiln-popup').forEach((popup) => {
|
||||
popup.hidden = true;
|
||||
});
|
||||
|
||||
if (typeof resetTaskPopup === 'function') {
|
||||
resetTaskPopup();
|
||||
}
|
||||
|
||||
if (typeof resetVersionPopup === 'function') {
|
||||
resetVersionPopup();
|
||||
}
|
||||
|
||||
if (typeof resetProjectPopup === 'function') {
|
||||
resetProjectPopup();
|
||||
}
|
||||
|
||||
const backdrop = document.getElementById('popupBackdrop');
|
||||
|
||||
if (backdrop) {
|
||||
backdrop.hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const openButton = event.target.closest('[data-popup-open]');
|
||||
const closeButton = event.target.closest('[data-popup-close]');
|
||||
const backdrop = event.target.closest('#popupBackdrop');
|
||||
|
||||
if (openButton) {
|
||||
if (openButton.dataset.popupOpen === 'createTask' && typeof openTaskCreatePopup === 'function') {
|
||||
openTaskCreatePopup();
|
||||
} else if (openButton.dataset.popupOpen === 'createProject' && typeof openProjectCreatePopup === 'function') {
|
||||
openProjectCreatePopup();
|
||||
} else {
|
||||
openPopup(openButton.dataset.popupOpen);
|
||||
}
|
||||
}
|
||||
|
||||
if (closeButton || backdrop) {
|
||||
closePopups();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Escape') {
|
||||
closePopups();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user