Fix Kanban issues

pull/1/head
yflory 4 years ago
parent 96362b20b1
commit 2756e1f2cd

@ -635,7 +635,7 @@ define([
gutter: '5px', gutter: '5px',
widthBoard: '300px', widthBoard: '300px',
buttonContent: '❌', buttonContent: '❌',
readOnly: framework.isReadOnly(), readOnly: framework.isReadOnly() || framework.isLocked(),
tagsAnd: _tagsAnd, tagsAnd: _tagsAnd,
refresh: function () { refresh: function () {
onRedraw.fire(); onRedraw.fire();
@ -869,7 +869,7 @@ define([
var addBoardDefault = document.getElementById('kanban-addboard'); var addBoardDefault = document.getElementById('kanban-addboard');
$(addBoardDefault).attr('title', Messages.kanban_addBoard); $(addBoardDefault).attr('title', Messages.kanban_addBoard);
addBoardDefault.addEventListener('click', function () { addBoardDefault.addEventListener('click', function () {
if (framework.isReadOnly()) { return; } if (framework.isReadOnly() || framework.isLocked()) { return; }
/*var counter = 1; /*var counter = 1;
// Get the new board id // Get the new board id
@ -1051,7 +1051,7 @@ define([
mkHelpMenu(framework); mkHelpMenu(framework);
} }
if (framework.isReadOnly()) { if (framework.isReadOnly() || framework.isLocked()) {
$container.addClass('cp-app-readonly'); $container.addClass('cp-app-readonly');
} else { } else {
framework.setFileImporter({}, function (content /*, file */) { framework.setFileImporter({}, function (content /*, file */) {

@ -458,13 +458,12 @@ define([
this.moveItem = function (source, eid, board, pos) { this.moveItem = function (source, eid, board, pos) {
var boards = self.options.boards; var boards = self.options.boards;
var same = -1; var same = -1;
console.error(source, eid, board, pos);
if (source && boards.data[source]) { if (source && boards.data[source]) {
// Remove from this board only // Remove from this board only
var l = boards.data[source].item; var l = boards.data[source].item;
var idx = l.indexOf(eid); var idx = l.indexOf(Number(eid));
if (idx !== -1) { l.splice(idx, 1); } if (idx !== -1) { l.splice(idx, 1); }
if (source === board) { same = idx; } if (boards.data[source] === board) { same = idx; }
} else { } else {
// Remove the item from all its board // Remove the item from all its board
var from = findItem(eid); var from = findItem(eid);

Loading…
Cancel
Save