-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move sharing page options to menu in top right #6652
Conversation
Nice pr! :)
What do you mean? |
Codecov Report
@@ Coverage Diff @@
## master #6652 +/- ##
=========================================
Coverage ? 50.61%
Complexity ? 24297
=========================================
Files ? 1577
Lines ? 92922
Branches ? 1359
=========================================
Hits ? 47036
Misses ? 45886
Partials ? 0
|
@skjnldsv I mean not showing that dropdown permanently, and only opening it on click of the Download action. :) |
Oh ok! :) $(document).ready(function() {
$('.app-navigation-entry-utils-menu-button button:not([class])').click(function() {
$(this).parents('.app-navigation-entry-utils').next().show();
});
})
$(document).mouseup(function(e) {
var container = $(".app-navigation-entry-menu");
// if the target of the click isn't the container nor a descendant of the container
if (!container.is(e.target) && container.has(e.target).length === 0) {
container.hide();
}
}); It's what I use on the simple template app I made, not sure if this is a good idea though :) |
c1ddb08
to
a42f62b
Compare
@skjnldsv added it, thanks! :) I tried to play around with |
Also I might have used a really rough way to decide if the download button should be shown under the filetype icon too – for files which can’t be previewed, i.e. anything except images: https://github.com/nextcloud/server/pull/6652/files#diff-28509333ad5b898bf1af427bd3e64113R103 cc @rullzer |
🏓 for review here :) |
Yes, please review @nextcloud/designers @nextcloud/javascript :) |
Everything seems good with this! But before I review, can anyone tell me what the "direct link" option is supposed to do? |
Direct link for images is supposed to only show the image (without background or header) so it can be embedded directly. For filetypes other than files which can directly be shown, it's basically just a link to the page (cause lots of regular people don't know a URL from the bar can be copied, and look for a "Copy link" option). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry there is so many changes needed 🙈
This is looking great nonetheless, much easier to read on mobile/narrow screens. 😅
But it makes me wonder if we shouldn't display as many button as we could and but them in the menu if there isn't enough space left, same as the app list on the nextcloud header. :)
<span id="download-text"><?php p($l->t('Download'))?></span> | ||
</a> | ||
<?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?> | ||
<a href="#" id="share-menutoggle" class="menutoggle icon-more-white"><span class="share-menutoggle-text"><?php p($l->t('Download')) ?></span></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the download link having the icon-more-white
class? This needs to be 2 separate elements. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Download is just the text label for the menu, so it's the same element. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels strange! :/ :)
</a> | ||
<?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?> | ||
<a href="#" id="share-menutoggle" class="menutoggle icon-more-white"><span class="share-menutoggle-text"><?php p($l->t('Download')) ?></span></a> | ||
<div id="share-menu" class="popovermenu menu hidden"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not need the hidden class as the popover is hidden by default.
apps/files_sharing/js/public.js
Outdated
@@ -424,4 +424,18 @@ $(document).ready(function () { | |||
return App.fileList.generatePreviewUrl(urlSpec); | |||
}; | |||
} | |||
|
|||
$('#share-menutoggle').click(function() { | |||
$('#share-menu').show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the class 'open'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the code you gave me above. ;)
apps/files_sharing/js/public.js
Outdated
|
||
// if the target of the click isn't the container nor a descendant of the container | ||
if (!container.is(e.target) && container.has(e.target).length === 0) { | ||
container.hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the class 'open'.
@@ -84,16 +100,14 @@ | |||
<!-- Preview frame is filled via JS to support SVG images for modern browsers --> | |||
<div id="imgframe"></div> | |||
<?php endif; ?> | |||
<?php if ($_['previewURL'] === $_['downloadURL']): ?> | |||
<div class="directDownload"> | |||
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not working on my setup, No response or feedback when clicking this link.
Maybe we should also fix this here?
@@ -143,6 +143,8 @@ | |||
#header-left, .header-left { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could have a display: inline-flex
for easier alignment .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s already set in the lines above. :)
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
d3a53ea
to
bc47668
Compare
ab45dd8
to
905b3c5
Compare
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
905b3c5
to
18dff92
Compare
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
This is now ready for review @nextcloud/javascript @nextcloud/designers @nextcloud/sharing! :) |
@skjnldsv can you re-review? :) @rullzer @schiessle @MorrisJobke can you also review please? |
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work!
Lets get this in!
Making the sharing page a bit cleaner. Before & after:
TO DO:
Clicking »Direct link« should copy it to clipboard and give that as feedback in a tooltip