Skip to content

Commit

Permalink
Merge pull request #17861 from nextcloud/fix-tab-navigation-of-menu-i…
Browse files Browse the repository at this point in the history
…n-public-share-pages

Fix tab navigation of menu in public share pages
  • Loading branch information
rullzer authored Jan 7, 2020
2 parents dd0979c + 883a71c commit 86bccde
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
13 changes: 11 additions & 2 deletions core/css/public.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ $footer-height: 65px;
ul li {
min-width: 270px;
}
#save-external-share {
#header-actions-toggle {
background-color: transparent;
border-color: transparent;

&:hover,
&:focus,
&:active {
opacity: 1;
}
}
#external-share-menu-item {
form {
display: flex;
margin: 0;
}
.hidden {
display: none;
Expand Down
5 changes: 2 additions & 3 deletions core/js/public/publicpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ $(document).ready(function () {
$(this).next('.popovermenu').toggleClass('open');
});

$('#save-external-share').find('label').click(function () {
$(this).toggleClass('hidden');
$('.save-form').toggleClass('hidden')
$('#save-external-share').click(function () {
$('#external-share-menu-item').toggleClass('hidden')
$('#remote_address').focus();
});

Expand Down
2 changes: 1 addition & 1 deletion core/templates/layout.public.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</span>
<?php if($template->getActionCount() > 1) { ?>
<div id="header-secondary-action">
<span id="header-actions-toggle" class="menutoggle icon-more-white"></span>
<button id="header-actions-toggle" class="menutoggle icon-more-white"></button>
<div id="header-actions-menu" class="popovermenu menu">
<ul>
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ public function __construct(string $label, string $icon, string $owner, string $
*/
public function render(): string {
return '<li>' .
'<a id="save-external-share" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' .
'<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
'<label for="remote_address">' . Util::sanitizeHTML($this->getLabel()) . '</label>' .
'<form class="save-form hidden" action="#">' .
'<input type="text" id="remote_address" placeholder="user@yourNextcloud.org">' .
'<input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
'</form>' .
'</a>' .
' <button id="save-external-share" class="icon ' . Util::sanitizeHTML($this->getIcon()) . '" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' . Util::sanitizeHTML($this->getLabel()) . '</button>' .
'</li>' .
'<li id="external-share-menu-item" class="hidden">' .
' <span class="menuitem">' .
' <form class="save-form" action="#">' .
' <input type="text" id="remote_address" placeholder="user@yourNextcloud.org">' .
' <input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
' </form>' .
' </span>' .
'</li>';
}
}

0 comments on commit 86bccde

Please sign in to comment.