Skip to content
Snippets Groups Projects
Commit e3198a6a authored by Bruce Flynn's avatar Bruce Flynn
Browse files

Show error when there are no images

parent 1fb6de15
No related branches found
No related tags found
No related merge requests found
......@@ -183,9 +183,14 @@
$.get(targeturl(), 'text')
.done(function(html) {
parseFilenamesFromHtml(html).forEach(function(filename) {
$('#images').append(template({filename: filename}));
});
var filenames = parseFilenamesFromHtml(html)
if (filenames.length) {
filenames.forEach(function(filename) {
$('#images').append(template({filename: filename}));
});
} else {
handleError('no images found');
}
})
.fail(function(error) {
handleError(error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment