// jkanban init (function() { if (document.getElementById("myKanban")) { var KanbanTest = new jKanban({ element: "#myKanban", gutter: "10px", widthBoard: "450px", click: el => { let jkanbanInfoModal = document.getElementById("jkanban-info-modal"); let jkanbanInfoModalTaskId = document.querySelector( "#jkanban-info-modal #jkanban-task-id" ); let jkanbanInfoModalTaskTitle = document.querySelector( "#jkanban-info-modal #jkanban-task-title" ); let jkanbanInfoModalTaskAssignee = document.querySelector( "#jkanban-info-modal #jkanban-task-assignee" ); let jkanbanInfoModalTaskDescription = document.querySelector( "#jkanban-info-modal #jkanban-task-description" ); let taskId = el.getAttribute("data-eid"); let taskTitle = el.querySelector('p.text').innerHTML; let taskAssignee = el.getAttribute("data-assignee"); let taskDescription = el.getAttribute("data-description"); jkanbanInfoModalTaskId.value = taskId; jkanbanInfoModalTaskTitle.value = taskTitle; jkanbanInfoModalTaskAssignee.value = taskAssignee; jkanbanInfoModalTaskDescription.value = taskDescription; }, buttonClick: function(el, boardId) { if ( document.querySelector("[data-id='" + boardId + "'] .itemform") === null ) { // create a form to enter element var formItem = document.createElement("form"); formItem.setAttribute("class", "itemform"); formItem.innerHTML = `
Click me to change title
', class: ["rounded-lg"] }, { id: "_task_2_title_id", title: 'Drag me to "In progress" section
', class: ["rounded-lg"] }, { id: "_task_do_something_id", title: 'PendingWebsite Design: New cards for blog section and profile details
', assignee: "Done Joe", description: "This task's description is for something, but not for anything", class: ["rounded-lg"] }, ] }, { id: "_progress", title: "In progress", item: [{ id: "_task_3_title_id", title: 'ErrorsFix Firefox errors
', class: ["rounded-lg"] }, { id: "_task_4_title_id", title: 'UpdatesArgon Dashboard PRO - Angular 11
', class: ["rounded-lg"] }, { id: "_task_do_something_4_id", title: 'UpdatesVue 3 Updates
', assignee: "Done Joe", description: "This task's description is for something, but not for anything", class: ["rounded-lg"] } ] }, { id: "_working", title: "In review", item: [{ id: "_task_do_something_2_id", title: 'In TestingResponsive Changes
', assignee: "Done Joe", description: "This task's description is for something, but not for anything", class: ["rounded-lg"] }, { id: "_task_run_id", title: 'In reviewChange images dimension
Update Links
Redesign for the home page
', assignee: "Done Joe", description: "This task's description is for something, but not for anything", class: ["rounded-lg"] }, { id: "_task_ok_id", title: 'DoneSchedule winter campaign
', assignee: "Done Joe", description: "This task's description is for something, but not for anything", class: ["rounded-lg"] } ] } ] }); var addBoardDefault = document.getElementById("jkanban-add-new-board"); addBoardDefault.addEventListener("click", function() { let newBoardName = document.getElementById("jkanban-new-board-name") .value; let newBoardId = "_" + newBoardName.toLowerCase().replace(/ /g, "_"); KanbanTest.addBoards([{ id: newBoardId, title: newBoardName, item: [] }]); document.querySelector('#new-board-modal').classList.remove('show'); document.querySelector('body').classList.remove('modal-open'); document.querySelector('.modal-backdrop').remove(); }); var updateTask = document.getElementById("jkanban-update-task"); updateTask.addEventListener("click", function() { let jkanbanInfoModalTaskId = document.querySelector( "#jkanban-info-modal #jkanban-task-id" ); let jkanbanInfoModalTaskTitle = document.querySelector( "#jkanban-info-modal #jkanban-task-title" ); let jkanbanInfoModalTaskAssignee = document.querySelector( "#jkanban-info-modal #jkanban-task-assignee" ); let jkanbanInfoModalTaskDescription = document.querySelector( "#jkanban-info-modal #jkanban-task-description" ); KanbanTest.replaceElement(jkanbanInfoModalTaskId.value, { title: jkanbanInfoModalTaskTitle.value, assignee: jkanbanInfoModalTaskAssignee.value, description: jkanbanInfoModalTaskDescription.value }); jkanbanInfoModalTaskId.value = jkanbanInfoModalTaskId.value; jkanbanInfoModalTaskTitle.value = jkanbanInfoModalTaskTitle.value; jkanbanInfoModalTaskAssignee.value = jkanbanInfoModalTaskAssignee.value; jkanbanInfoModalTaskDescription.value = jkanbanInfoModalTaskDescription.value; document.querySelector('#jkanban-info-modal').classList.remove('show'); document.querySelector('body').classList.remove('modal-open'); document.querySelector('.modal-backdrop').remove(); }); } })();