summaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/Http
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-11-07 21:30:56 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-12-30 10:29:36 +0100
commit883a71ce8e00d317e1827deacf46ee0c37934485 (patch)
tree4af874efc9cabf30d01f20f69de755362b08ba1b /lib/public/AppFramework/Http
parent33b2f4e29589e6a415612f7d15525659847f3a8a (diff)
downloadnextcloud-server-883a71ce8e00d317e1827deacf46ee0c37934485.tar.gz
nextcloud-server-883a71ce8e00d317e1827deacf46ee0c37934485.zip
Split the menu entry for external shares in two
The external shares entry showed a "button" that, when pressed, replaced the button with the input to set the remote share address. The "button" was actually a label for the input, so when the label was focused it transferred the focus to the input and thus pressing enter or space did not show the input. Moreover, inputs inside links are not valid HTML, and once shown there was no way to hide the input again. Due to all this, and for consistency with the direct link input, the external share input was moved to a different menu item that is shown and hidden when the button, which nows is also a real button, is clicked. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib/public/AppFramework/Http')
-rw-r--r--lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php b/lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php
index 47f62d9f8fd..33ca3be94aa 100644
--- a/lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php
+++ b/lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php
@@ -67,14 +67,15 @@ class ExternalShareMenuAction extends SimpleMenuAction {
*/
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="#">' .
+ ' <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>' .
- ' </a>' .
+ ' </span>' .
'</li>';
}
}