From 592c7598a26ea9c7e648ce5422b1b1f2f101852a Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Fri, 8 Apr 2016 22:07:17 +0200 Subject: [PATCH] Show share button when logged out #473 --- src/scripts/contextMenu.js | 10 +++++----- src/scripts/lychee.js | 10 ++++++++-- src/styles/_header.scss | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/scripts/contextMenu.js b/src/scripts/contextMenu.js index 1782cc0..999792e 100644 --- a/src/scripts/contextMenu.js +++ b/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) diff --git a/src/scripts/lychee.js b/src/scripts/lychee.js index f6f6f6a..03bb681 100644 --- a/src/scripts/lychee.js +++ b/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') diff --git a/src/styles/_header.scss b/src/styles/_header.scss index f727063..88f7aa2 100644 --- a/src/styles/_header.scss +++ b/src/styles/_header.scss @@ -95,6 +95,8 @@ &--eye.active .iconic { fill: #ff9737; } + &--share .iconic { height: 18px; } + &--info.active .iconic { fill: $colorBlue; } }