Browse Source

Fixed sharing information in album infobox

Tobias Reich 10 years ago
parent
commit
e7cb1b1c77
3 changed files with 24 additions and 6 deletions
  1. 0 0
      dist/main.js
  2. 15 4
      src/scripts/album.js
  3. 9 2
      src/scripts/view.js

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


+ 15 - 4
src/scripts/album.js

@@ -454,6 +454,7 @@ album.setPublic = function(albumID, e) {
 
 	if (basicModal.visible()) {
 
+		// Set password
 		if ($('.basicModal .choice input[name="password"]:checked').length===1) {
 			password			= $('.basicModal .choice input[data-name="password"]').val();
 			album.json.password	= '1';
@@ -462,18 +463,28 @@ album.setPublic = function(albumID, e) {
 			album.json.password	= '0';
 		}
 
-		if ($('.basicModal .choice input[name="listed"]:checked').length===1)		listed = true;
-		if ($('.basicModal .choice input[name="downloadable"]:checked').length===1)	downloadable = true;
+		// Set downloadable
+		if ($('.basicModal .choice input[name="downloadable"]:checked').length===1) {
+			downloadable			= true;
+			album.json.downloadable	= '1';
+		} else {
+			downloadable			= false;
+			album.json.downloadable	= '0';
+		}
+
+		if ($('.basicModal .choice input[name="listed"]:checked').length===1) listed = true;
 
 	}
 
 	if (visible.album()) {
 
-		album.json.public	= (album.json.public==='0') ? '1' : '0';
-		album.json.password	= (album.json.public==='0') ? '0' : album.json.password;
+		album.json.public		= (album.json.public==='0') ? '1' : '0';
+		album.json.password		= (album.json.public==='0') ? '0' : album.json.password;
+		album.json.downloadable	= (album.json.public==='0') ? '0' : album.json.downloadable;
 
 		view.album.public();
 		view.album.password();
+		view.album.downloadable();
 
 		if (album.json.public==='1') contextMenu.shareAlbum(albumID, e);
 

+ 9 - 2
src/scripts/view.js

@@ -261,7 +261,7 @@ view.album = {
 
 			$('.photo .iconic-share').remove();
 
-			if (album.json.init) $('#infobox .attr_visibility').html('Public');
+			if (album.json.init) $('#infobox .attr_public').html('Yes');
 
 		} else {
 
@@ -269,7 +269,7 @@ view.album = {
 				.removeClass('active')
 				.attr('title', 'Make Public');
 
-			if (album.json.init) $('#infobox .attr_visibility').html('Private');
+			if (album.json.init) $('#infobox .attr_public').html('No');
 		}
 
 	},
@@ -281,6 +281,13 @@ view.album = {
 
 	},
 
+	downloadable: function() {
+
+		if (album.json.downloadable==='1')	$('#infobox .attr_downloadable').html('Yes');
+		else								$('#infobox .attr_downloadable').html('No');
+
+	},
+
 	infobox: function() {
 
 		if ((visible.album()||!album.json.init)&&!visible.photo()) lychee.infobox.find('.wrapper').html(build.infoboxAlbum(album.json));

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