Skip to content
Snippets Groups Projects
Commit fd6b10b0 authored by Demian Katz's avatar Demian Katz
Browse files

Hide empty visualizations.

parent 10aa4bb1
Branches
Tags
No related merge requests found
......@@ -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");
......
......@@ -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; ?>
<?
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment