Browse Source

Fixed fadeIn fadeOut animations

Tobias Reich 9 years ago
parent
commit
4a6a86e7c7
3 changed files with 11 additions and 9 deletions
  1. 2 2
      src/scripts/album.js
  2. 3 3
      src/scripts/albums.js
  3. 6 4
      src/scripts/search.js

+ 2 - 2
src/scripts/album.js

@@ -36,7 +36,7 @@ album.load = function(albumID, refresh) {
 	password.get(albumID, function() {
 
 		if (!refresh) {
-			lychee.animate('.album:nth-child(-n+50), .photo:nth-child(-n+50)', 'contentZoomOut');
+			lychee.animate('.album, .photo', 'contentZoomOut');
 			lychee.animate('.divider', 'fadeOut');
 		}
 
@@ -79,7 +79,7 @@ album.load = function(albumID, refresh) {
 				view.album.init();
 
 				if (!refresh) {
-					lychee.animate('.album:nth-child(-n+50), .photo:nth-child(-n+50)', 'contentZoomIn');
+					lychee.animate('.album, .photo', 'contentZoomIn');
 					view.header.mode('album');
 				}
 

+ 3 - 3
src/scripts/albums.js

@@ -15,7 +15,7 @@ albums.load = function() {
 		durationTime,
 		waitTime;
 
-	lychee.animate('.album:nth-child(-n+50), .photo:nth-child(-n+50)', 'contentZoomOut');
+	lychee.animate('.album, .photo', 'contentZoomOut');
 	lychee.animate('.divider', 'fadeOut');
 
 	startTime = new Date().getTime();
@@ -79,7 +79,7 @@ albums.load = function() {
 			setTimeout(function() {
 				view.header.mode('albums');
 				view.albums.init();
-				lychee.animate('.album:nth-child(-n+50), .photo:nth-child(-n+50)', 'contentZoomIn');
+				lychee.animate('.album, .photo', 'contentZoomIn');
 			}, waitTime);
 		});
 
@@ -88,7 +88,7 @@ albums.load = function() {
 		setTimeout(function() {
 			view.header.mode('albums');
 			view.albums.init();
-			lychee.animate('.album:nth-child(-n+50), .photo:nth-child(-n+50)', 'contentZoomIn');
+			lychee.animate('.album, .photo', 'contentZoomIn');
 		}, 300);
 
 	}

+ 6 - 4
src/scripts/search.js

@@ -55,17 +55,19 @@ search.find = function(term) {
 
 					$('.no_content').remove();
 
-					lychee.animate('.album:nth-child(-n+50), .photo:nth-child(-n+50)', 'contentZoomOut');
+					lychee.animate('.album, .photo', 'contentZoomOut');
 					lychee.animate('.divider', 'fadeOut');
 
 					search.code = md5(code);
 
 					setTimeout(function() {
 
-						if (code==='error') $('body').append(build.no_content('search'));
-						else {
+						if (code==='error') {
+							lychee.content.html('');
+							$('body').append(build.no_content('search'));
+						} else {
 							lychee.content.html(code);
-							lychee.animate('.album:nth-child(-n+50), .photo:nth-child(-n+50)', 'contentZoomIn');
+							lychee.animate('.album, .photo', 'contentZoomIn');
 							$('img[data-type!="svg"]').retina();
 						}