Improved if-conditions

This commit is contained in:
Tobias Reich 2015-02-28 23:39:28 +01:00
parent e39d70ab15
commit 389142385d
2 changed files with 5 additions and 5 deletions

View File

@ -19,12 +19,12 @@ $(document).ready(function() {
else contextMenu.albumTitle(album.getID(), e);
});
header.dom('#button_share').on(eventName, function(e) {
if (photo.json.public==1||photo.json.public==2) contextMenu.sharePhoto(photo.getID(), e);
else photo.setPublic(photo.getID(), e);
if (photo.json.public==='1'||photo.json.public==='2') contextMenu.sharePhoto(photo.getID(), e);
else photo.setPublic(photo.getID(), e);
});
header.dom('#button_share_album').on(eventName, function(e) {
if (album.json.public==1) contextMenu.shareAlbum(album.getID(), e);
else album.setPublic(album.getID(), e);
if (album.json.public==='1') contextMenu.shareAlbum(album.getID(), e);
else album.setPublic(album.getID(), true, e);
});
header.dom('#button_signin') .on(eventName, lychee.loginDialog);
header.dom('#button_settings') .on(eventName, contextMenu.settings);

View File

@ -418,7 +418,7 @@ photo.setStar = function(photoIDs) {
photo.setPublic = function(photoID, e) {
if (photo.json.public==2) {
if (photo.json.public==='2') {
var action;