From f316c6b85a42d67f392698b39886d75badd5a3df Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 10 Mar 2020 17:29:40 +0100 Subject: [PATCH] Fix losing scroll position on remote changes --- www/kanban/jkanban.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/kanban/jkanban.js b/www/kanban/jkanban.js index a6606c787..19c51b6f6 100644 --- a/www/kanban/jkanban.js +++ b/www/kanban/jkanban.js @@ -573,14 +573,20 @@ } this.setBoards = function (boards) { + var scroll = {}; //self.element for (var i in this.options.boards.list) { var boardkey = this.options.boards.list[i]; + scroll[boardkey] = $('.kanban-board[data-id="'+boardkey+'"] .kanban-drag').scrollTop(); this.removeBoard(boardkey); } this.options.boards = boards; this.addBoards(); self.options.refresh(); + this.options.boards.list.forEach(function (id) { + if (!scroll[id]) { return; } + $('.kanban-board[data-id="'+id+'"] .kanban-drag').scrollTop(scroll[id]); + }); } this.findBoard = function (id) {