From f0512bbb1de66eff641e5d3112bdbe4b7bdf5e97 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 22 May 2018 18:22:25 +0200 Subject: [PATCH] Fix UI and realtime issues with kanban --- www/kanban/app-kanban.less | 17 +++++++++-- www/kanban/inner.js | 62 +++++++++++++++++++++++++++++--------- www/kanban/jkanban.js | 32 ++++++++------------ 3 files changed, 74 insertions(+), 37 deletions(-) diff --git a/www/kanban/app-kanban.less b/www/kanban/app-kanban.less index 3e2b26bcb..60dd58135 100644 --- a/www/kanban/app-kanban.less +++ b/www/kanban/app-kanban.less @@ -84,16 +84,27 @@ .tools_unselectable(); } - .kanban-removeboard { + .kanban-additem, .kanban-remove-item { float: right; - margin: 10px; + background: #EEE; + padding: .25rem .5rem; + line-height: 1; + &:hover { + background: transparent; + } +/* margin: 10px; padding: 3px; width: 30px; text-align: center; background: #eee; font-weight: bold; cursor: pointer; - .tools_unselectable(); + .tools_unselectable(); */ + } + + .kanban-additem { + margin-bottom: 5px; + margin-right: 5px; } .kanban-header-yellow { diff --git a/www/kanban/inner.js b/www/kanban/inner.js index 03d2a5389..c6cbebb32 100644 --- a/www/kanban/inner.js +++ b/www/kanban/inner.js @@ -1,5 +1,6 @@ define([ 'jquery', + 'json.sortify', '/bower_components/nthen/index.js', '/common/sframe-common.js', '/common/sframe-app-framework.js', @@ -12,6 +13,7 @@ define([ 'css!/kanban/jkanban.css', ], function ( $, + Sortify, nThen, SFCommon, Framework, @@ -25,6 +27,23 @@ define([ var verbose = function (x) { console.log(x); }; verbose = function () {}; // comment out to enable verbose logging + var addRemoveItemButton = function (framework, kanban) { + var $container = $(kanban.element); + $container.find('.kanban-remove-item').remove(); + $container.find('.kanban-board .kanban-item').each(function (i, el) { + var pos = kanban.findElementPosition(el); + var board = kanban.options.boards.find(function (b) { + return b.id === $(el.parentNode.parentNode).attr('data-id'); + }); + $('