]> source.dussan.org Git - nextcloud-server.git/commitdiff
oc-89 handling no photos in collection alert
authorBartek Przybylski <bart.p.pl@gmail.com>
Mon, 23 Jan 2012 22:25:36 +0000 (23:25 +0100)
committerBartek Przybylski <bart.p.pl@gmail.com>
Mon, 23 Jan 2012 22:25:36 +0000 (23:25 +0100)
apps/gallery/js/album_cover.js

index 44503de28e03d324865e0b5327be708174e0a7c7..513dd47d351a68409d54152e526cb7b4698d4545 100644 (file)
@@ -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) {