From dcdccd683d05909244a2428f2c6716ecd08fa3f5 Mon Sep 17 00:00:00 2001 From: cTn Date: Sat, 15 Mar 2014 15:43:08 +0100 Subject: [PATCH] detach listeners and remove element data --- js/serial_backend.js | 5 +++++ main.js | 3 +++ 2 files changed, 8 insertions(+) diff --git a/js/serial_backend.js b/js/serial_backend.js index 3905e33bcd..2bd9be2979 100644 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -48,6 +48,11 @@ $(document).ready(function() { sensor_status(sensors_detected = 0); // reset active sensor indicators $('#tabs > ul li').removeClass('active'); // de-select any selected tabs + + // detach listeners and remove element data + $('#content').empty(); + + // load default html tab_initialize_default(); } diff --git a/main.js b/main.js index 14b4263e23..8ac0abdcd7 100644 --- a/main.js +++ b/main.js @@ -69,6 +69,9 @@ $(document).ready(function() { // Highlight selected tab $(self).parent().addClass('active'); + // detach listeners and remove element data + $('#content').empty(); + switch (tab) { case 'tab_initial_setup': tab_initialize_initial_setup();