5
function kanbanSortable() {
6
$('[data-sortable="true"]').sortable({
7
connectWith: ".connect-sorting-content",
10
placeholder: "ui-state-highlight",
11
refreshPosition: true,
12
stop: function (event, ui) {
13
var parent_ui = ui.item.parent().attr("data-item");
15
update: function (event, ui) {
25
function clearItem() {
28
.on("click", function (event) {
29
event.preventDefault();
31
.parents('[data-action="sorting"]')
32
.find(".connect-sorting-content .card")
40
function addKanbanItem() {
41
$(".addTask").on("click", function (event) {
42
event.preventDefault();
43
getParentElement = $(this)
44
.parents('[data-action="sorting"]')
46
$(".edit-task-title").hide();
47
$(".add-task-title").show();
48
$('[data-btn-action="addTask"]').show();
49
$('[data-btn-action="editTask"]').hide();
50
$("#addItemModal").modal("show");
51
kanban_add(getParentElement);
58
function kanban_add(getParent) {
59
$('[data-btn-action="addTask"]')
61
.on("click", function (event) {
62
getAddBtnClass = $(this).attr("class").split(" ")[1];
64
var today = new Date();
65
var dd = String(today.getDate()).padStart(2, "0");
66
var mm = String(today.getMonth());
83
today = dd + " " + monthNames[mm];
85
var $_getParent = getParent;
87
var itemTitle = document.getElementById("kanban-title").value;
88
var itemText = document.getElementById("kanban-text").value;
91
'<div data-draggable="true" class="card task-text-progress" style="">' +
92
'<div class="card-body">' +
93
'<div class="task-header">' +
95
'<h4 class="" data-item-title="' +
102
'<div class="dropdown">' +
103
'<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink-4" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">' +
104
'<i class="ti ti-dots-vertical text-dark"></i>' +
106
'<div class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuLink-4">' +
107
'<a class="dropdown-item kanban-item-edit cursor-pointer d-flex align-items-center gap-1" href="javascript:void(0);"><i class="ti ti-pencil fs-5"></i>Edit</a>' +
108
'<a class="dropdown-item kanban-item-delete cursor-pointer d-flex align-items-center gap-1" href="javascript:void(0);"><i class="ti ti-trash fs-5"></i>Delete</a>' +
113
'<div class="task-body">' +
114
'<div class="task-content">' +
115
'<p class="mb-0" data-item-text="' +
121
'<div class="task-bottom">' +
122
'<div class="tb-section-1">' +
123
'<span class="hstack gap-2 fs-2" data-item-date="' +
125
'"><i class="ti ti-calendar fs-5"></i> ' +
129
'<div class="tb-section-2">' +
130
'<span class="badge text-bg-success fs-1">Design</span>' +
137
$("[data-item='" + $_getParent + "'] .connect-sorting-content").append(
141
$("#addItemModal").modal("hide");
153
.on("click", function (event) {
154
event.preventDefault();
156
$(".add-list").show();
157
$(".edit-list").hide();
158
$(".edit-list-title").hide();
159
$(".add-list-title").show();
160
$("#addListModal").modal("show");
168
.on("click", function (event) {
169
var today = new Date();
170
var dd = String(today.getDate()).padStart(2, "0");
171
var mm = String(today.getMonth() + 1).padStart(2, "0");
173
today = mm + "." + dd;
175
var itemTitle = document.getElementById("item-name").value;
177
var itemNameLowercase = itemTitle.toLowerCase();
178
var itemNameRemoveWhiteSpace = itemNameLowercase.split(" ").join("_");
179
var itemDataAttr = itemNameRemoveWhiteSpace;
182
'<div data-item="item-' +
184
'" class="task-list-container mb-4 " data-action="sorting">' +
185
'<div class="connect-sorting">' +
186
'<div class="task-container-header">' +
187
'<h6 class="item-head mb-0 fs-4 fw-semibold" data-item-title="' +
192
'<div class="hstack gap-2">' +
193
'<div class="dropdown">' +
194
'<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink-4" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">' +
195
'<i class="ti ti-dots-vertical text-dark"></i>' +
197
'<div class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuLink-4">' +
198
'<a class="dropdown-item list-edit" href="javascript:void(0);">Edit</a>' +
199
'<a class="dropdown-item list-delete" href="javascript:void(0);">Delete</a>' +
200
'<a class="dropdown-item list-clear-all" href="javascript:void(0);">Clear All</a>' +
205
'<div class="connect-sorting-content" data-sortable="true">' +
210
$(".task-list-section").append(item_html);
211
$("#addListModal").modal("hide");
212
$("#item-name").val("");
224
var tooltipTriggerList = [].slice.call(
225
document.querySelectorAll('[data-bs-toggle="tooltip"]')
227
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
228
return new bootstrap.Tooltip(tooltipTriggerEl);
235
function editItem() {
238
.on("click", function (event) {
239
event.preventDefault();
241
var parentItem = $(this);
243
$(".add-list").hide();
244
$(".edit-list").show();
246
$(".add-list-title").hide();
247
$(".edit-list-title").show();
249
var itemTitle = parentItem
250
.parents('[data-action="sorting"]')
252
.attr("data-item-title");
253
$("#item-name").val(itemTitle);
257
.on("click", function (event) {
258
var $_innerThis = $(this);
259
var $_getListTitle = document.getElementById("item-name").value;
261
var $_editedListTitle = parentItem
262
.parents('[data-action="sorting"]')
264
.html($_getListTitle);
265
var $_editedListTitleDataAttr = parentItem
266
.parents('[data-action="sorting"]')
268
.attr("data-item-title", $_getListTitle);
270
$("#addListModal").modal("hide");
271
$("#item-name").val("");
273
$("#addListModal").modal("show");
274
$("#addListModal").on("hidden.bs.modal", function (e) {
275
$("#item-name").val("");
283
function deleteItem() {
286
.on("click", function (event) {
287
event.preventDefault();
288
$(this).parents("[data-action]").remove();
295
function kanbanDelete() {
296
$(".card .kanban-item-delete")
298
.on("click", function (event) {
299
event.preventDefault();
301
get_card_parent = $(this).parents(".card");
303
$("#deleteConformation").modal("show");
305
$('[data-remove="task"]').on("click", function (event) {
306
event.preventDefault();
308
get_card_parent.remove();
309
$("#deleteConformation").modal("hide");
317
function kanbanEdit() {
318
$(".card .kanban-item-edit")
320
.on("click", function (event) {
321
event.preventDefault();
323
var parentItem = $(this);
325
$(".add-task-title").hide();
326
$(".edit-task-title").show();
328
$('[data-btn-action="addTask"]').hide();
329
$('[data-btn-action="editTask"]').show();
331
var itemKanbanTitle = parentItem
334
.attr("data-item-title");
335
var get_kanban_title = $(".task-text-progress #kanban-title").val(
339
var itemText = parentItem
341
.find('p:not(".progress-count")')
342
.attr("data-item-text");
343
var get_kanban_text = $(".task-text-progress #kanban-text").val(
347
$('[data-btn-action="editTask"]')
349
.on("click", function (event) {
350
var kanbanValueTitle =
351
document.getElementById("kanban-title").value;
352
var kanbanValueText = document.getElementById("kanban-text").value;
354
var itemDataAttr = parentItem
357
.attr("data-item-title", kanbanValueTitle);
358
var itemKanbanTitle = parentItem
361
.html(kanbanValueTitle);
362
var itemTextDataAttr = parentItem
364
.find('p:not(".progress-count")')
365
.attr("data-tasktext", kanbanValueText);
366
var itemText = parentItem
368
.find('p:not(".progress-count")')
369
.html(kanbanValueText);
371
$("#addItemModal").modal("hide");
372
var setDate = $(".taskDate").html("");
373
$(".taskDate").hide();
375
$("#addItemModal").modal("show");