Avoid to send XHR request when a task has not moved after a drag and drop
This commit is contained in:
@@ -9,6 +9,7 @@ New features:
|
|||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
* Avoid to send XHR request when a task has not moved after a drag and drop
|
||||||
* Set maximum dropzone height when the individual column scrolling is disabled
|
* Set maximum dropzone height when the individual column scrolling is disabled
|
||||||
* Always show the search box in board selector
|
* Always show the search box in board selector
|
||||||
* Replace logout link by a dropdown menu
|
* Replace logout link by a dropdown menu
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
<?= $task['is_active'] == 1 ? ($this->user->hasProjectAccess('board', 'save', $task['project_id']) ? 'draggable-item ' : '').'task-board-status-open '.($task['date_modification'] > (time() - $board_highlight_period) ? 'task-board-recent' : '') : 'task-board-status-closed' ?>
|
<?= $task['is_active'] == 1 ? ($this->user->hasProjectAccess('board', 'save', $task['project_id']) ? 'draggable-item ' : '').'task-board-status-open '.($task['date_modification'] > (time() - $board_highlight_period) ? 'task-board-recent' : '') : 'task-board-status-closed' ?>
|
||||||
color-<?= $task['color_id'] ?>"
|
color-<?= $task['color_id'] ?>"
|
||||||
data-task-id="<?= $task['id'] ?>"
|
data-task-id="<?= $task['id'] ?>"
|
||||||
|
data-column-id="<?= $task['column_id'] ?>"
|
||||||
|
data-swimlane-id="<?= $task['swimlane_id'] ?>"
|
||||||
|
data-position="<?= $task['position'] ?>"
|
||||||
data-owner-id="<?= $task['owner_id'] ?>"
|
data-owner-id="<?= $task['owner_id'] ?>"
|
||||||
data-category-id="<?= $task['category_id'] ?>"
|
data-category-id="<?= $task['category_id'] ?>"
|
||||||
data-due-date="<?= $task['date_due'] ?>"
|
data-due-date="<?= $task['date_due'] ?>"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -108,16 +108,22 @@ Board.prototype.dragAndDrop = function() {
|
|||||||
placeholder: "draggable-placeholder",
|
placeholder: "draggable-placeholder",
|
||||||
items: ".draggable-item",
|
items: ".draggable-item",
|
||||||
stop: function(event, ui) {
|
stop: function(event, ui) {
|
||||||
var taskId = ui.item.attr('data-task-id');
|
var task = ui.item;
|
||||||
ui.item.removeClass("draggable-item-selected");
|
var taskId = task.attr('data-task-id');
|
||||||
self.changeTaskState(taskId);
|
var taskPosition = task.attr('data-position');
|
||||||
|
var taskColumnId = task.attr('data-column-id');
|
||||||
|
var taskSwimlaneId = task.attr('data-swimlane-id');
|
||||||
|
|
||||||
self.save(
|
var newColumnId = task.parent().attr("data-column-id");
|
||||||
taskId,
|
var newSwimlaneId = task.parent().attr('data-swimlane-id');
|
||||||
ui.item.parent().attr("data-column-id"),
|
var newPosition = task.index() + 1;
|
||||||
ui.item.index() + 1,
|
|
||||||
ui.item.parent().attr('data-swimlane-id')
|
task.removeClass("draggable-item-selected");
|
||||||
);
|
|
||||||
|
if (newColumnId != taskColumnId || newSwimlaneId != taskSwimlaneId || newPosition != taskPosition) {
|
||||||
|
self.changeTaskState(taskId);
|
||||||
|
self.save(taskId, newColumnId, newPosition, newSwimlaneId);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
start: function(event, ui) {
|
start: function(event, ui) {
|
||||||
ui.item.addClass("draggable-item-selected");
|
ui.item.addClass("draggable-item-selected");
|
||||||
|
|||||||
Reference in New Issue
Block a user