From 68893ae402c19e6f88f2fa8da674cea08e9e1673 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Fri, 30 Jan 2015 00:34:08 +0100 Subject: [PATCH] Fixed photo badge not updating --- src/scripts/album.js | 3 +-- src/scripts/build.coffee | 8 ++++---- src/scripts/view.js | 10 +++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/scripts/album.js b/src/scripts/album.js index b3a4244..d598cd5 100644 --- a/src/scripts/album.js +++ b/src/scripts/album.js @@ -447,8 +447,6 @@ album.setPublic = function(albumID, e) { } - params = 'setAlbumPublic&albumID=' + albumID + '&password=' + password + '&visible=' + listed + '&downloadable=' + downloadable; - if (visible.album()) { 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) { if (data!==true) lychee.error(null, params, data); diff --git a/src/scripts/build.coffee b/src/scripts/build.coffee index d052571..f1d96b9 100644 --- a/src/scripts/build.coffee +++ b/src/scripts/build.coffee @@ -59,8 +59,8 @@ build.album = (data) -> if lychee.publicMode is false - if data.star is '1' then html += "#{ build.iconic('star') }" - if data.public is '1' then html += "#{ build.iconic('eye') }" + if data.star is '1' then html += "#{ build.iconic('star') }" + if data.public is '1' then html += "#{ build.iconic('eye') }" if data.unsorted is '1' then html += "#{ build.iconic('list') }" if data.recent is '1' then html += "#{ build.iconic('clock') }" @@ -94,8 +94,8 @@ build.photo = (data) -> html += "" - if data.star is '1' then html += "#{ build.iconic('star') }" - if lychee.publicMode is false and data.public is '1' and album.json.public isnt '1' then html += "#{ build.iconic('eye') }" + if data.star is '1' then html += "#{ build.iconic('star') }" + if lychee.publicMode is false and data.public is '1' and album.json.public isnt '1' then html += "#{ build.iconic('eye') }" html += "" diff --git a/src/scripts/view.js b/src/scripts/view.js index c3dce58..01b6821 100644 --- a/src/scripts/view.js +++ b/src/scripts/view.js @@ -205,15 +205,15 @@ view.album = { star: function(photoID) { - $('.photo[data-id="' + photoID + '"] .icon-star').remove(); - if (album.json.content[photoID].star==1) $('.photo[data-id="' + photoID + '"]').append(""); + $('.photo[data-id="' + photoID + '"] .iconic-star').remove(); + if (album.json.content[photoID].star==1) $('.photo[data-id="' + photoID + '"]').append("" + build.iconic('star') + ""); }, public: function(photoID) { - $('.photo[data-id="' + photoID + '"] .icon-share').remove(); - if (album.json.content[photoID].public==1) $('.photo[data-id="' + photoID + '"]').append(""); + $('.photo[data-id="' + photoID + '"] .iconic-share').remove(); + if (album.json.content[photoID].public==1) $('.photo[data-id="' + photoID + '"]').append("" + build.iconic('eye') + ""); }, @@ -253,7 +253,7 @@ view.album = { if (album.json.public==1) { $('#button_share_album a').addClass('active'); $('#button_share_album').attr('title', 'Share Album'); - $('.photo .icon-share').remove(); + $('.photo .iconic-share').remove(); if (album.json.init) $('#infobox .attr_visibility').html('Public'); } else { $('#button_share_album a').removeClass('active');