Browse Source

Show share button when logged out #473

Tobias Reich 9 years ago
parent
commit
592c7598a2
3 changed files with 15 additions and 7 deletions
  1. 5 5
      src/scripts/contextMenu.js
  2. 8 2
      src/scripts/lychee.js
  3. 2 0
      src/styles/_header.scss

+ 5 - 5
src/scripts/contextMenu.js

@@ -306,8 +306,8 @@ contextMenu.sharePhoto = function(photoID, e) {
 		{ title: build.iconic('envelope-closed') + 'Mail', fn: () => photo.share(photoID, 'mail') },
 		{ title: build.iconic('dropbox', iconClass) + 'Dropbox', fn: () => photo.share(photoID, 'dropbox') },
 		{ title: build.iconic('link-intact') + 'Direct Link', fn: () => window.open(photo.getDirectLink()) },
-		{ },
-		{ title: build.iconic('ban') + 'Make Private', fn: () => photo.setPublic(photoID) }
+		{ visible: lychee.publicMode===false },
+		{ title: build.iconic('ban') + 'Make Private', visible: lychee.publicMode===false, fn: () => photo.setPublic(photoID) }
 	]
 
 	basicContext.show(items, e.originalEvent)
@@ -325,9 +325,9 @@ contextMenu.shareAlbum = function(albumID, e) {
 		{ title: build.iconic('twitter', iconClass) + 'Twitter', fn: () => album.share('twitter') },
 		{ title: build.iconic('facebook', iconClass) + 'Facebook', fn: () => album.share('facebook') },
 		{ title: build.iconic('envelope-closed') + 'Mail', fn: () => album.share('mail') },
-		{ },
-		{ title: build.iconic('pencil') + 'Edit Sharing', fn: () => album.setPublic(albumID, true, e) },
-		{ title: build.iconic('ban') + 'Make Private', fn: () => album.setPublic(albumID, false) }
+		{ visible: lychee.publicMode===false },
+		{ title: build.iconic('pencil') + 'Edit Sharing', visible: lychee.publicMode===false, fn: () => album.setPublic(albumID, true, e) },
+		{ title: build.iconic('ban') + 'Make Private', visible: lychee.publicMode===false, fn: () => album.setPublic(albumID, false) }
 	]
 
 	basicContext.show(items, e.originalEvent)

+ 8 - 2
src/scripts/lychee.js

@@ -236,8 +236,14 @@ lychee.setTitle = function(title, editable) {
 
 lychee.setMode = function(mode) {
 
-	$('#button_settings, #button_trash_album, #button_share_album, .button_add, .header__divider').remove()
-	$('#button_trash, #button_move, #button_share, #button_star').remove()
+	$('#button_settings, #button_trash_album, .button_add, .header__divider').remove()
+	$('#button_trash, #button_move, #button_star').remove()
+
+	$('#button_share, #button_share_album')
+		.removeClass('button--eye')
+		.addClass('button--share')
+		.find('use')
+		.attr('xlink:href', '#share')
 
 	$(document)
 		.off('click',       '.header__title--editable')

+ 2 - 0
src/styles/_header.scss

@@ -95,6 +95,8 @@
 
 		&--eye.active .iconic { fill: #ff9737; }
 
+		&--share .iconic { height: 18px; }
+
 		&--info.active .iconic { fill: $colorBlue; }
 	}