aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-12-21 13:52:03 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-12-21 14:19:29 +0100
commiteb256b3ed52422c33459321f2a9cf745d5ef6adc (patch)
treee9e96836674891867fe9f623ca9fcce332074134 /apps/files_sharing
parentdc8809e754c22addaab20401a7505dcc4082541c (diff)
downloadnextcloud-server-eb256b3ed52422c33459321f2a9cf745d5ef6adc.tar.gz
nextcloud-server-eb256b3ed52422c33459321f2a9cf745d5ef6adc.zip
Fix anchor change when clicking on sharing page menu
The share menu toggle and some share menu items included an 'href="#"' attribute, so they were handled as internal links by the browser, which changed the current anchor when they were clicked. However, there was no real need to change the anchor in those cases, and it could interfere with other apps (for example, the PDF viewer sets the current anchor to "#pdfviewer" when it is shown and it hides itself when that anchor is modified). According to the HTML 5 spec the "href" attribute is not mandatory for "a" elements, so they were removed. Other options would have been to change the elements from "a" to "div" or something like that, but that would have required changes to the CSS rules too, or to prevent the default event handling for those elements through JavaScript, which would have been a workaround instead of the proper solution. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/templates/public.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index e17595d548b..9d28c178dde 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -50,7 +50,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<div class="header-right">
<?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>
+ <a 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">
<ul>
<li>
@@ -60,7 +60,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
</a>
</li>
<li>
- <a href="#" id="directLink-container">
+ <a id="directLink-container">
<span class="icon icon-public"></span>
<label for="directLink"><?php p($l->t('Direct link')) ?></label>
<input id="directLink" type="text" readonly value="<?php p($_['previewURL']); ?>">
@@ -68,7 +68,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
</li>
<?php if ($_['server2serversharing']) { ?>
<li>
- <a href="#" id="save" data-protected="<?php p($_['protected']) ?>"
+ <a id="save" data-protected="<?php p($_['protected']) ?>"
data-owner-display-name="<?php p($_['displayName']) ?>" data-owner="<?php p($_['owner']) ?>" data-name="<?php p($_['filename']) ?>">
<span class="icon icon-external"></span>
<span id="save-button"><?php p($l->t('Add to your Nextcloud')) ?></span>