Skip to content

Commit

Permalink
Display when no results were returned
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Jan 26, 2019
1 parent 2d16deb commit 4f983d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions annif/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ <h2 class="mt-4">Results</h2>\
success: function(data) {
// need to iterate and push, so that we do not change the pointer to the constant!
// TBD: replace once using shared data (state pattern, or vuex)
if (data.results.length === 0) {
$('#results').append(
$("<p>No results returned</p>")
);
return;
}
for (var i = 0; i < data.results.length; i++) {
var result = data.results[i];
this_.results.push(result);
Expand Down

0 comments on commit 4f983d9

Please sign in to comment.