Browse Source

Merge branch 'master' of https://github.com/electerious/Lychee into multiselect

Tobias Reich 11 years ago
parent
commit
7166a536e4
3 changed files with 16 additions and 6 deletions
  1. 0 0
      assets/js/min/main.js
  2. 6 2
      assets/js/modules/build.js
  3. 10 4
      assets/js/modules/view.js

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


+ 6 - 2
assets/js/modules/build.js

@@ -69,14 +69,18 @@ build = {
 		if (!photoJSON) return "";
 
 		var photo = "",
+			longTitle = "",
 			title = photoJSON.title;
 
-		if (title.length>18) title = photoJSON.title.substr(0, 18) + "...";
+		if (title.length>18) {
+			title = photoJSON.title.substr(0, 18) + "...";
+			longTitle = photoJSON.title;
+		}
 
 		photo += "<div class='photo' data-album-id='" + photoJSON.album + "' data-id='" + photoJSON.id + "'>";
 		photo +=	"<img src='" + photoJSON.thumbUrl + "' width='200' height='200' alt='thumb'>";
 		photo +=	"<div class='overlay'>";
-		photo +=		"<h1>" + title + "</h1>";
+		photo +=		"<h1 title='" + longTitle + "'>" + title + "</h1>";
 		photo +=		"<a>" + photoJSON.sysdate + "</a>";
 		photo +=	"</div>";
 

+ 10 - 4
assets/js/modules/view.js

@@ -167,8 +167,8 @@ view = {
 
 				if (albums.json.content[albumID].password) prefix = "<span class='icon-lock'></span> ";
 				if (title.length>18) {
+					longTitle = title;
 					title = title.substr(0, 18) + "...";
-					longTitle = albums.json.content[albumID].title;
 				}
 
 				$(".album[data-id='" + albumID + "'] .overlay h1")
@@ -262,11 +262,17 @@ view = {
 
 			title: function(photoID) {
 
-				var title = album.json.content[photoID].title;
+				var longTitle = "",
+					title = album.json.content[photoID].title;
 
-				if (title.length>18) title = title.substr(0, 18) + "...";
+				if (title.length>18) {
+					longTitle = title;
+					title = title.substr(0, 18) + "...";
+				}
 
-				$(".photo[data-id='" + photoID + "'] .overlay h1").html(title);
+				$(".photo[data-id='" + photoID + "'] .overlay h1")
+					.html(title)
+					.attr("title", longTitle);
 
 			},
 

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