From ac4dba11670f93289ca6318c3c06b49bf4ec0811 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 1 Feb 2017 12:02:09 +0100 Subject: [statistics_reporting] Fix loadForm() and further js interaction if sessionStorage is still empty --- .../statistics_reporting/templates/columnChooser.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules-available/statistics_reporting') diff --git a/modules-available/statistics_reporting/templates/columnChooser.html b/modules-available/statistics_reporting/templates/columnChooser.html index 513bc36b..cfaf086c 100644 --- a/modules-available/statistics_reporting/templates/columnChooser.html +++ b/modules-available/statistics_reporting/templates/columnChooser.html @@ -159,9 +159,12 @@ var cutoff = getQueryVariable("cutoff"); $('#select-cutoff').val(cutoff ? cutoff : 7); - sessionStorage.getItem("buttons").split(" ").forEach(function(button) { - toggleButton(button.substr(7)); - }); + var buttons = sessionStorage.getItem("buttons"); + if (buttons) { + buttons.split(" ").forEach(function (button) { + toggleButton(button.substr(7)); + }); + } } function getQueryVariable(variable) -- cgit v1.2.3-55-g7522