Boxes will try to remember their state and auto-collapse.

This commit is contained in:
James Cole
2016-04-29 09:47:47 +02:00
parent 14b94a5bd2
commit b714eaac06
6 changed files with 90 additions and 49 deletions

View File

@@ -285,6 +285,19 @@ function areaChart(URL, container, options) {
function columnChart(URL, container, options) {
"use strict";
// find the parent box:
var cont = $('#' + container);
var box = cont.parents(".box").first();
var boxId = box.attr('id');
if (boxId) {
var state = getBoxState(boxId);
if (state == 'closed') {
console.log('Will not draw columnChart(' + URL + ') because ' + boxId + ' is closed.');
return;
}
}
options = options || {};
$.getJSON(URL).done(function (data) {