Fixed photo badge not updating

This commit is contained in:
Tobias Reich 2015-01-30 00:34:08 +01:00
parent b84ab4fd2c
commit 68893ae402
3 changed files with 10 additions and 11 deletions

View File

@ -447,8 +447,6 @@ album.setPublic = function(albumID, e) {
} }
params = 'setAlbumPublic&albumID=' + albumID + '&password=' + password + '&visible=' + listed + '&downloadable=' + downloadable;
if (visible.album()) { if (visible.album()) {
album.json.public = (album.json.public==0) ? 1 : 0; album.json.public = (album.json.public==0) ? 1 : 0;
@ -461,6 +459,7 @@ album.setPublic = function(albumID, e) {
} }
params = 'setAlbumPublic&albumID=' + albumID + '&password=' + password + '&visible=' + listed + '&downloadable=' + downloadable;
lychee.api(params, function(data) { lychee.api(params, function(data) {
if (data!==true) lychee.error(null, params, data); if (data!==true) lychee.error(null, params, data);

View File

@ -59,8 +59,8 @@ build.album = (data) ->
if lychee.publicMode is false if lychee.publicMode is false
if data.star is '1' then html += "<a class='badge'>#{ build.iconic('star') }</a>" if data.star is '1' then html += "<a class='badge icn-star'>#{ build.iconic('star') }</a>"
if data.public is '1' then html += "<a class='badge'>#{ build.iconic('eye') }</a>" if data.public is '1' then html += "<a class='badge icn-share'>#{ build.iconic('eye') }</a>"
if data.unsorted is '1' then html += "<a class='badge'>#{ build.iconic('list') }</a>" if data.unsorted is '1' then html += "<a class='badge'>#{ build.iconic('list') }</a>"
if data.recent is '1' then html += "<a class='badge'>#{ build.iconic('clock') }</a>" if data.recent is '1' then html += "<a class='badge'>#{ build.iconic('clock') }</a>"
@ -94,8 +94,8 @@ build.photo = (data) ->
html += "</div>" html += "</div>"
if data.star is '1' then html += "<a class='badge'>#{ build.iconic('star') }</a>" if data.star is '1' then html += "<a class='badge iconic-star'>#{ build.iconic('star') }</a>"
if lychee.publicMode is false and data.public is '1' and album.json.public isnt '1' then html += "<a class='badge'>#{ build.iconic('eye') }</a>" if lychee.publicMode is false and data.public is '1' and album.json.public isnt '1' then html += "<a class='badge iconic-share'>#{ build.iconic('eye') }</a>"
html += "</div>" html += "</div>"

View File

@ -205,15 +205,15 @@ view.album = {
star: function(photoID) { star: function(photoID) {
$('.photo[data-id="' + photoID + '"] .icon-star').remove(); $('.photo[data-id="' + photoID + '"] .iconic-star').remove();
if (album.json.content[photoID].star==1) $('.photo[data-id="' + photoID + '"]').append("<a class='badge red icon-star'></a>"); if (album.json.content[photoID].star==1) $('.photo[data-id="' + photoID + '"]').append("<a class='badge iconic-star'>" + build.iconic('star') + "</a>");
}, },
public: function(photoID) { public: function(photoID) {
$('.photo[data-id="' + photoID + '"] .icon-share').remove(); $('.photo[data-id="' + photoID + '"] .iconic-share').remove();
if (album.json.content[photoID].public==1) $('.photo[data-id="' + photoID + '"]').append("<a class='badge red icon-share'></a>"); if (album.json.content[photoID].public==1) $('.photo[data-id="' + photoID + '"]').append("<a class='badge iconic-share'>" + build.iconic('eye') + "</a>");
}, },
@ -253,7 +253,7 @@ view.album = {
if (album.json.public==1) { if (album.json.public==1) {
$('#button_share_album a').addClass('active'); $('#button_share_album a').addClass('active');
$('#button_share_album').attr('title', 'Share Album'); $('#button_share_album').attr('title', 'Share Album');
$('.photo .icon-share').remove(); $('.photo .iconic-share').remove();
if (album.json.init) $('#infobox .attr_visibility').html('Public'); if (album.json.init) $('#infobox .attr_visibility').html('Public');
} else { } else {
$('#button_share_album a').removeClass('active'); $('#button_share_album a').removeClass('active');