From 81a80da7c5252c0226ae974f2b319c5458889c58 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 10 Oct 2013 00:15:50 +0200 Subject: [PATCH] Fix: boxes are actually removed when they don't respond --- js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 031bedd..b1be3ed 100644 --- a/js/main.js +++ b/js/main.js @@ -99,6 +99,7 @@ function checkBox(box) { updateIntro(); } }).fail(function() { + //console.log("box not alive: "+box.wifiboxid); numBoxesChecking--; removeBox(box); updateIntro(); @@ -115,7 +116,8 @@ function boxExists(localip){ return $list.find("a[id|='"+localip+"']").length > 0; } function removeBox(box) { - $list.remove("a[id|='"+box.localip+"']"); + var $element = $list.find("a[id|='"+box.localip+"']"); + $element.remove(); } function updateIntro() {