Fix null item in kanban
This commit is contained in:
parent
3f77a800cf
commit
b558d6e354
@ -286,7 +286,7 @@ define([
|
|||||||
kanban.inEditMode = true;
|
kanban.inEditMode = true;
|
||||||
// create a form to enter element
|
// create a form to enter element
|
||||||
var boardId = $(el.parentNode.parentNode).attr("data-id");
|
var boardId = $(el.parentNode.parentNode).attr("data-id");
|
||||||
var $item = $('<div>', {'class': 'kanban-item'});
|
var $item = $('<div>', {'class': 'kanban-item new-item'});
|
||||||
var $input = getInput().val(name).appendTo($item);
|
var $input = getInput().val(name).appendTo($item);
|
||||||
kanban.addForm(boardId, $item[0]);
|
kanban.addForm(boardId, $item[0]);
|
||||||
$input.focus();
|
$input.focus();
|
||||||
|
|||||||
@ -147,9 +147,13 @@
|
|||||||
self.drake = self.dragula(self.boardContainer, {
|
self.drake = self.dragula(self.boardContainer, {
|
||||||
moves: function (el, source, handle, sibling) {
|
moves: function (el, source, handle, sibling) {
|
||||||
if (self.options.readOnly) { return false; }
|
if (self.options.readOnly) { return false; }
|
||||||
|
if (el.classList.contains('new-item')) { return false; }
|
||||||
return handle.classList.contains('kanban-item');
|
return handle.classList.contains('kanban-item');
|
||||||
},
|
},
|
||||||
accepts: function (el, target, source, sibling) {
|
accepts: function (el, target, source, sibling) {
|
||||||
|
if (sibling === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (self.options.readOnly) { return false; }
|
if (self.options.readOnly) { return false; }
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user