diff --git a/themes/blueprint/js/pubdate_vis.js b/themes/blueprint/js/pubdate_vis.js index 7ec28d252b4c080e662baaecf55e7d6f130239b7..36a61348af3b9e02a8f9cce7bf778e3e27c041a8 100644 --- a/themes/blueprint/js/pubdate_vis.js +++ b/themes/blueprint/js/pubdate_vis.js @@ -23,7 +23,12 @@ function loadVis(facetFields, searchParams, baseURL, zooming) { $.getJSON(url, function (data) { if (data.status == 'OK') { $.each(data['data'], function(key, val) { - //console.log(val); + //check if there is data to display, if there isn't hide the box + if (val['data'].length == 0){ + $("#datevis" + key + "xWrapper").hide(); + return; + } + // plot graph var placeholder = $("#datevis" + key + "x"); diff --git a/themes/blueprint/templates/Recommend/PubDateVisAjax.phtml b/themes/blueprint/templates/Recommend/PubDateVisAjax.phtml index 1ded1375862bec1766f02c9d851f6decd067692e..ea8ece5913069bb2cb25e92cbd1572ab97ce884f 100644 --- a/themes/blueprint/templates/Recommend/PubDateVisAjax.phtml +++ b/themes/blueprint/templates/Recommend/PubDateVisAjax.phtml @@ -9,10 +9,12 @@ <? foreach ($visFacets as $facetField=>$facetRange): ?> <div class="authorbox"> - <strong><?=$this->translate($facetRange['label']) ?></strong> - <? /* space the flot visualisation */ ?> - <div id="datevis<?=$facetField ?>x" style="margin:0 10px;width:auto;height:80px;cursor:crosshair;"></div> - <div id="clearButtonText" style="display: none"><?=$this->translate('Clear') ?></div> + <div id="datevis<?=$this->escapeHtml($facetField)?>xWrapper"> + <strong><?=$this->translate($facetRange['label']) ?></strong> + <? /* space the flot visualisation */ ?> + <div id="datevis<?=$facetField ?>x" style="margin:0 10px;width:auto;height:80px;cursor:crosshair;"></div> + <div id="clearButtonText" style="display: none"><?=$this->translate('Clear') ?></div> + </div> </div> <? endforeach; ?> <?