Skip to content
Snippets Groups Projects
Commit dd5f6a48 authored by NGUYEN Bao's avatar NGUYEN Bao
Browse files

Issue #3502689: Drag-and-drop functionality in Kanban board is inconsistent...

Issue #3502689: Drag-and-drop functionality in Kanban board is inconsistent and counters are not updating correctly
parent d69ce617
No related branches found
No related tags found
No related merge requests found
Pipeline #408492 passed
/** @format */
(function ($, Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings, once) {
"use strict";
function countTotal(status, operation = '+') {
status = (status + '').replace(' ', '');
let selectorTotal = $('.status-' + status + ' .total-status');
let total = parseInt(selectorTotal.text());
if (operation == '+') {
if (operation === '+') {
total += 1;
} else {
total -= 1;
......@@ -21,7 +21,7 @@
point = parseInt(point);
let selectorTotal = $('.status-' + status + ' .card-header .total .badge');
let total = parseInt(selectorTotal.text());
if (operation == '+') {
if (operation === '+') {
total += point;
} else {
total -= point;
......@@ -92,6 +92,7 @@
// Generate URL for AJAX call.
let url = "views-kanban/update-state/" + view_id + "/" + display_id + "/" + entityId + "/" + stateValue;
let article = $("#" + elementId).detach();
article.data('value',stateValue);
$(this).prepend(article);
let color = $(this).parent().data('color');
$(this).parent().removeClass(`bg-${color}-subtle`);
......@@ -185,4 +186,4 @@
}
};
})(jQuery, Drupal, drupalSettings);
})(jQuery, Drupal, drupalSettings, once);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment