Browse Source

Avoid console error on retina-screens

Tobias Reich 10 years ago
parent
commit
77398cab56
3 changed files with 9 additions and 5 deletions
  1. 0 0
      assets/js/min/main.js
  2. 7 3
      assets/js/modules/build.js
  3. 2 2
      assets/js/modules/view.js

File diff suppressed because it is too large
+ 0 - 0
assets/js/min/main.js


+ 7 - 3
assets/js/modules/build.js

@@ -27,11 +27,15 @@ build = {
 			title = albumJSON.title;
 
 		if (title.length>18) title = albumJSON.title.substr(0, 18) + "...";
+		
+		typeThumb0 = albumJSON.thumb0.split('.').pop();
+		typeThumb1 = albumJSON.thumb1.split('.').pop();
+		typeThumb2 = albumJSON.thumb2.split('.').pop();
 
 		album += "<div  class='album' data-id='" + albumJSON.id + "' data-password='" + albumJSON.password + "'>";
-		album +=	"<img src='" + albumJSON.thumb2 + "' width='200' height='200' alt='thumb'>";
-		album +=	"<img src='" + albumJSON.thumb1 + "' width='200' height='200' alt='thumb'>";
-		album +=	"<img src='" + albumJSON.thumb0 + "' width='200' height='200' alt='thumb'>";
+		album +=	"<img src='" + albumJSON.thumb2 + "' width='200' height='200' alt='thumb' data-type='" + typeThumb2 + "'>";
+		album +=	"<img src='" + albumJSON.thumb1 + "' width='200' height='200' alt='thumb' data-type='" + typeThumb1 + "'>";
+		album +=	"<img src='" + albumJSON.thumb0 + "' width='200' height='200' alt='thumb' data-type='" + typeThumb0 + "'>";
 		album +=	"<div class='overlay'>";
 
 		if (albumJSON.password&&!lychee.publicMode) album += "<h1><span class='icon-lock'></span> " + title + "</h1>";

+ 2 - 2
assets/js/modules/view.js

@@ -154,7 +154,7 @@ view = {
 				if (smartData===""&&albumsData==="") $("body").append(build.no_content("picture"));
 				else lychee.content.html(smartData + albumsData);
 
-				$("img").retina();
+				$("img[data-type!='svg']").retina();
 
 			},
 
@@ -249,7 +249,7 @@ view = {
 				});
 				lychee.content.html(photosData);
 
-				$("img").retina();
+				$("img[data-type!='svg']").retina();
 
 			},
 

Some files were not shown because too many files changed in this diff