From 6b8cec9fbe1b2656597ba321246ac608940ed980 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 21 Jun 2020 18:13:31 +0200 Subject: Fix unsubscribe, which didn't remove the board root node. --- src/ws/handler.js | 5 +++++ src/ws/view.js | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/ws/handler.js b/src/ws/handler.js index 38b3fd5..5bb7892 100644 --- a/src/ws/handler.js +++ b/src/ws/handler.js @@ -26,6 +26,11 @@ function removeEventHandler(e) var id = e.detail.id; var node = findNode(id, subscribeid); + if(node.id == node.subscribeid) + { + removeBoard(subscribeid); + } + if(node.parent) { node.parent.removeChild(node); diff --git a/src/ws/view.js b/src/ws/view.js index 8e349d5..b8ef19a 100644 --- a/src/ws/view.js +++ b/src/ws/view.js @@ -37,6 +37,15 @@ function getBoard(subscribeid) return board; } +function removeBoard(subscribeid) +{ + var board = document.getElementById("board_" + subscribeid); + if(board) + { + boards.removeChild(board); + } +} + ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// -- cgit v1.2.3