I can't even upload file when click at new contract now
Browse files- index.html +2 -2
- script.js +5 -8
index.html
CHANGED
|
@@ -27,8 +27,8 @@
|
|
| 27 |
<!-- File cards will be added here dynamically -->
|
| 28 |
|
| 29 |
<!-- Add new file card -->
|
| 30 |
-
<div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300 cursor-pointer" id="add-file-card">
|
| 31 |
-
|
| 32 |
<i data-feather="plus" class="w-16 h-16 text-blue-500 mb-4"></i>
|
| 33 |
<h3 class="text-xl font-semibold text-gray-800">Add New Contract</h3>
|
| 34 |
</div>
|
|
|
|
| 27 |
<!-- File cards will be added here dynamically -->
|
| 28 |
|
| 29 |
<!-- Add new file card -->
|
| 30 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300 cursor-pointer" id="add-file-card" onclick="document.getElementById('upload-modal').classList.remove('hidden')">
|
| 31 |
+
<div class="p-8 flex flex-col items-center justify-center h-full">
|
| 32 |
<i data-feather="plus" class="w-16 h-16 text-blue-500 mb-4"></i>
|
| 33 |
<h3 class="text-xl font-semibold text-gray-800">Add New Contract</h3>
|
| 34 |
</div>
|
script.js
CHANGED
|
@@ -25,18 +25,15 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
| 25 |
const uploadModal = document.getElementById('upload-modal');
|
| 26 |
const closeModal = document.getElementById('close-modal');
|
| 27 |
const uploadForm = document.getElementById('upload-form');
|
| 28 |
-
|
| 29 |
// Open modal when add file card is clicked
|
| 30 |
-
|
| 31 |
-
|
| 32 |
});
|
| 33 |
-
|
| 34 |
// Close modal
|
| 35 |
-
|
| 36 |
-
|
| 37 |
});
|
| 38 |
-
|
| 39 |
-
// Handle file upload
|
| 40 |
uploadForm.addEventListener('submit', async (e) => {
|
| 41 |
e.preventDefault();
|
| 42 |
|
|
|
|
| 25 |
const uploadModal = document.getElementById('upload-modal');
|
| 26 |
const closeModal = document.getElementById('close-modal');
|
| 27 |
const uploadForm = document.getElementById('upload-form');
|
|
|
|
| 28 |
// Open modal when add file card is clicked
|
| 29 |
+
document.getElementById('add-file-card').addEventListener('click', () => {
|
| 30 |
+
document.getElementById('upload-modal').classList.remove('hidden');
|
| 31 |
});
|
|
|
|
| 32 |
// Close modal
|
| 33 |
+
document.getElementById('close-modal').addEventListener('click', () => {
|
| 34 |
+
document.getElementById('upload-modal').classList.add('hidden');
|
| 35 |
});
|
| 36 |
+
// Handle file upload
|
|
|
|
| 37 |
uploadForm.addEventListener('submit', async (e) => {
|
| 38 |
e.preventDefault();
|
| 39 |
|