Skip to content

Commit

Permalink
Revise render template to handle missing annotation values
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidStirling committed Feb 7, 2024
1 parent 0ce8da5 commit 899e6a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var CustomAnnsPane = function CustomAnnsPane($element, opts) {
ann.addedBy = [ann.link.owner.id];
// convert 'class' to 'type' E.g. XmlAnnotationI to Xml
ann.type = ann.class.replace('AnnotationI', '');
var attrs = ['name', 'textValue', 'timeValue', 'termValue', 'longValue', 'doubleValue', 'boolValue'];
var attrs = ['textValue', 'timeValue', 'termValue', 'longValue', 'doubleValue', 'boolValue'];
attrs.forEach(function(a){
if (ann[a] !== undefined){
ann.value = ann[a];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
<div><% print(_.escape((ann.value + "").slice(0, 20))) %>...</div>
<div class="show_xml">Open in new window</div>
<div style="display: none"><%- ann.value %></div>
<% } else { %>
<% } else if (ann.value != null) { %>
<div><%- ann.value %></div>
<% } else if (ann.type === 'List' && ann.name) { %>
<div><%- ann.name %></div>
<% } else { %>
<div>(No data)</div>
<% } %>
</div>

Expand Down

0 comments on commit 899e6a8

Please sign in to comment.