MCPcopy Create free account
hub / github.com/Muhammadsiddiq-code/Admin-dashboard / showAddNewsModal

Function showAddNewsModal

app.js:665–693  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

663}
664
665function showAddNewsModal() {
666 const content = `
667 <form id="addNewsForm">
668 <div class="form-group">
669 <label>Sarlavha</label>
670 <input type="text" id="newsTitle" required>
671 </div>
672 <div class="form-group">
673 <label>Matn</label>
674 <textarea id="newsContent" rows="5" required style="width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: var(--border-radius);"></textarea>
675 </div>
676 <div class="form-group">
677 <label>Rasm</label>
678 <input type="file" id="newsImage" accept="image/*">
679 </div>
680 <div class="form-group">
681 <button type="submit" class="btn btn-primary">Qo'shish</button>
682 <button type="button" class="btn btn-secondary" onclick="closeModal()">Bekor qilish</button>
683 </div>
684 </form>
685 `
686
687 showModal("Yangi Yangilik Qo'shish", content)
688
689 document.getElementById("addNewsForm").addEventListener("submit", (e) => {
690 e.preventDefault()
691 addNews()
692 })
693}
694
695function closeModal() {
696 document.getElementById("modal").classList.remove("show")

Callers 1

setupButtonListenersFunction · 0.85

Calls 2

showModalFunction · 0.85
addNewsFunction · 0.85

Tested by

no test coverage detected