// **------ tab js** $(document).on('click', '.tab-link', function () { const tabID = $(this).attr('data-tab'); $(this).addClass('active').siblings().removeClass('active'); $('#tab-' + tabID).addClass('active').siblings().removeClass('active'); }); "use strict"; $(function () { const tooltipInit = { init: function () { $("a").tooltip(); } }; tooltipInit.init(); }); // Add New Card Js function projectCardContent() { const files = document.querySelector(".file_upload").files; return `
0 ? URL.createObjectURL(files[0]) : "" } alt="image" class="h-40 w-40 d-flex-center b-r-50 overflow-hidden" id="preview">
${$('#pName').val()}
Admin
Start Date : ${$('#startDate').val()}
End Date : ${$('#endDate').val()}

Pricing

${$('#pricing').val()}

${$('#projectDescription').val()}

Progress
50%
` } function getActions() { try { document.querySelectorAll('.delete-button').forEach(function (btn) { btn.addEventListener('click', function (event) { const deletbtn = event.target.closest(".project-card"); // document.querySelector('#delet-tab-pane .row').appendChild(deletbtn.cloneNode(true)); deletbtn.closest(".project-card").remove(); }); }); } catch (e) { console.error("Error in getActions: ", e); } } function resetModalInputs() { $('#pName').val(''); $('#startDate').val(''); $('#endDate').val(''); $('#pricing').val(''); $('#projectDescription').val(''); document.querySelector(".file_upload").value = ''; } try { document.querySelector('#addCard').onclick = function (event) { const rowElement = document.querySelector("#tab-1 .row"); rowElement.insertAdjacentHTML('afterbegin', projectCardContent()); resetModalInputs(); $("#projectCard").modal("hide"); getActions(); } } catch (e) { console.error("Error in addCard: ", e); } getActions();