Commit 684becdf authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

deal with undefined meta

parent cd84c723
......@@ -143,15 +143,17 @@ $(document).ready(function() {
// ==================================================================================
function fill_metadata(meta) {
if (meta.length == 0) {
$('#meta-panel').hide();
if (meta === undefined || meta.length == 0) {
$('#md').hide();
$('#meta-collapse').hide();
} else {
html = ""
meta.forEach(item => {
html += '<p><b>' + item.key + ' = </b>' + item.value + '</p>\n';
});
$('#metadata').html(html);
$('#meta-panel').show();
$('#md').show();
$('#meta-collapse').show();
}
}
......
......@@ -268,7 +268,7 @@
<div id="meta-panel" class="panel panel-default" style="margin-bottom:4px;">
<a id="md" onclick="toggle_metadata_icon()" data-toggle="collapse" href="#collapse1" class="collapsed">
<a id="md" onclick="toggle_metadata_icon()" data-toggle="collapse" href="#meta-collapse" class="collapsed">
<button class="btn btn-primary btn-sm">Metadata
<span id="md-icon" class="glyphicon glyphicon-chevron-right"> </span>
</button>
......@@ -283,9 +283,9 @@
<span href="" class="glyphicon glyphicon-export"></span>
</button>
</a>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div id="meta-collapse" class="panel-collapse collapse">
<div id="metadata" class="panel-body">
</div>
</div>
......
Markdown is supported
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