summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-06-21 18:13:31 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-06-21 18:13:55 +0200
commit6b8cec9fbe1b2656597ba321246ac608940ed980 (patch)
tree813c71f5fefc81e4a08c76454b01a28000215845
parent52e40517a51637bee9a5780259b88ee3f28599a2 (diff)
Fix unsubscribe, which didn't remove the board root node.
-rw-r--r--src/ws/handler.js5
-rw-r--r--src/ws/view.js9
2 files changed, 14 insertions, 0 deletions
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);
+ }
+}
+
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////