From 884f2b465d5bf3679d26cf5f97d254ac9d8ea09d Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 25 May 2018 11:49:43 +0200 Subject: [PATCH] Fix kanban creation --- www/kanban/inner.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/www/kanban/inner.js b/www/kanban/inner.js index 0bcaa2bb3..be2906e87 100644 --- a/www/kanban/inner.js +++ b/www/kanban/inner.js @@ -30,6 +30,7 @@ define([ var COLORS = ['yellow', 'green', 'orange', 'blue', 'red', 'purple', 'cyan', 'lightgreen', 'lightblue']; var addRemoveItemButton = function (framework, kanban) { + if (!kanban) { return; } if (framework.isReadOnly() || framework.isLocked()) { return; } var $container = $(kanban.element); $container.find('.kanban-remove-item').remove(); @@ -325,6 +326,7 @@ define([ } framework.onEditableChange(function (unlocked) { if (framework.isReadOnly()) { return; } + if (!kanban) { return; } if (unlocked) { addRemoveItemButton(framework, kanban); kanban.options.readOnly = false; @@ -357,7 +359,11 @@ define([ }); framework.setContentGetter(function () { - if (!kanban) { return; } + if (!kanban) { + return { + content: [] + }; + } var content = kanban.getBoardsJSON(); verbose("Content current value is " + content); return { @@ -369,6 +375,10 @@ define([ $("#cp-app-kanban-content").focus(); }); + framework.onDefaultContentNeeded(function () { + kanban = initKanban(framework); + }); + framework.start(); };