From 456394d3ec03e2e0d582ded9db1c92d037d13d36 Mon Sep 17 00:00:00 2001 From: Bartek Przybylski Date: Mon, 23 Jan 2012 23:25:36 +0100 Subject: [PATCH] oc-89 handling no photos in collection alert --- apps/gallery/js/album_cover.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/gallery/js/album_cover.js b/apps/gallery/js/album_cover.js index 44503de28e0..513dd47d351 100644 --- a/apps/gallery/js/album_cover.js +++ b/apps/gallery/js/album_cover.js @@ -44,7 +44,11 @@ function scanForAlbums() { if (r.status == 'success') { totalAlbums = r.paths.length; - $('#notification').text(t('gallery',"Creating thumbnails")+' ... ' + Math.floor((albumCounter/totalAlbums)*100) + "%"); + if (totalAlbums == 0) { + $('#notification').text(t('gallery', "No photos found")).fadeIn().slideDown().delay(3000).fadeOut().slideUp(); + return; + } + $('#notification').text(t('gallery',"Creating thumbnails")+' ... ' + Math.floor((albumCounter/totalAlbums)*100) + "%"); for(var a in r.paths) { $.getJSON('ajax/galleryOp.php?operation=partial_create&path='+r.paths[a], function(r) { -- 2.39.5