Fixed ext share style and use varable for popover height

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-03-07 14:57:07 +01:00
parent e2910e17b0
commit 446a3a9d5a
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
5 changed files with 48 additions and 29 deletions

View File

@ -26,7 +26,6 @@
var TEMPLATE_FILENAME_FORM = var TEMPLATE_FILENAME_FORM =
'<form class="filenameform">' + '<form class="filenameform">' +
'<label class="hidden-visually" for="{{cid}}-input-{{fileType}}">{{fileName}}</label>' +
'<input id="{{cid}}-input-{{fileType}}" type="text" value="{{fileName}}" autocomplete="off" autocapitalize="off">' + '<input id="{{cid}}-input-{{fileType}}" type="text" value="{{fileName}}" autocomplete="off" autocapitalize="off">' +
'<input type="submit" value=" " class="icon-confirm" />' '<input type="submit" value=" " class="icon-confirm" />'
'</form>'; '</form>';

View File

@ -105,8 +105,7 @@ thead {
border-color: rgba(0,0,0,0.3) !important; border-color: rgba(0,0,0,0.3) !important;
} }
#share-menu input[type='text'] {
#remote_address {
width: 200px; width: 200px;
} }

View File

@ -278,12 +278,6 @@ OCA.Sharing.PublicApp = {
} }
}); });
$('#save #save-button').click(function () {
$(this).hide();
$('.save-form').css('display', 'inline');
$('#remote_address').focus();
});
// legacy // legacy
window.FileList = this.fileList; window.FileList = this.fileList;
}, },

View File

@ -58,11 +58,15 @@ class ExternalShareMenuAction extends SimpleMenuAction {
'<a id="save" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' . '<a id="save" 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>' . '<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
'<span id="save-button">' . Util::sanitizeHTML($this->getLabel()) . '</span>' . '<span id="save-button">' . Util::sanitizeHTML($this->getLabel()) . '</span>' .
'<form class="save-form hidden" action="#">' . '</a>' .
'</li>' .
'<li>' .
'<span class="menuitem">' .
'<form class="save-form" action="#">' .
'<input type="text" id="remote_address" placeholder="user@yourNextcloud.org">' . '<input type="text" id="remote_address" placeholder="user@yourNextcloud.org">' .
'<input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' . '<input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
'</form>' . '</form>' .
'</a>' . '</span>' .
'</li>'; '</li>';
} }
} }

View File

@ -737,6 +737,9 @@ kbd {
} }
/* POPOVER MENU ------------------------------------------------------------- */ /* POPOVER MENU ------------------------------------------------------------- */
$popoveritem-height: 38px;
$popovericon-size: 16px;
.ie, .ie,
.edge { .edge {
.bubble, .bubble:after, .bubble, .bubble:after,
@ -813,11 +816,11 @@ kbd {
> a, > a,
> .menuitem { > .menuitem {
cursor: pointer; cursor: pointer;
line-height: 38px; line-height: $popoveritem-height;
border: 0; border: 0;
background-color: transparent; background-color: transparent;
display: flex; display: flex;
align-items: center; align-items: flex-start;
height: auto; height: auto;
margin: 0; margin: 0;
font-weight: 300; font-weight: 300;
@ -832,28 +835,28 @@ kbd {
&[class*=' icon-'] { &[class*=' icon-'] {
min-width: 0; /* Overwrite icons*/ min-width: 0; /* Overwrite icons*/
min-height: 0; min-height: 0;
background-position: 10px center; background-position: #{($popoveritem-height - $popovericon-size) / 2} center;
background-size: 16px; background-size: $popovericon-size;
} }
span[class^='icon-'], span[class^='icon-'],
span[class*=' icon-'] { span[class*=' icon-'] {
/* Keep padding to define the width to /* Keep padding to define the width to
assure correct position of a possible text */ assure correct position of a possible text */
padding: 18px 0 18px 36px; padding: #{$popoveritem-height / 2} 0 #{$popoveritem-height / 2} $popoveritem-height;
} }
// If no icons set, force left margin to align // If no icons set, force left margin to align
&:not([class^='icon-']):not([class*='icon-']) { &:not([class^='icon-']):not([class*='icon-']) {
> span, > span,
> input, > input,
> form { > form {
&:not([class^='icon-']):not([class*='icon-']):first-of-type { &:not([class^='icon-']):not([class*='icon-']):first-child {
margin-left: 36px; margin-left: $popoveritem-height;
} }
} }
} }
&[class^='icon-'], &[class^='icon-'],
&[class*=' icon-'] { &[class*=' icon-'] {
padding: 0 10px 0 36px !important; padding: 0 #{($popoveritem-height - $popovericon-size) / 2} 0 $popoveritem-height !important;
} }
&:hover, &:focus, &.active { &:hover, &:focus, &.active {
opacity: 1 !important; opacity: 1 !important;
@ -879,9 +882,11 @@ kbd {
&:not(:empty) { &:not(:empty) {
padding-right: 10px !important; padding-right: 10px !important;
} }
/* DEPRECATED! old img in popover fallback
* TODO: to remove */
> img { > img {
width: 16px; width: $popovericon-size;
padding: 0 10px; padding: #{($popoveritem-height - $popovericon-size) / 2};
} }
/* checkbox/radio fixes */ /* checkbox/radio fixes */
> input.radio + label, > input.radio + label,
@ -901,25 +906,43 @@ kbd {
form { form {
display: flex; display: flex;
flex: 1 1 auto; flex: 1 1 auto;
/* put a small space between text and form
if there is an element before */
&:not(:first-child) {
margin-left: 5px;
}
}
/* no margin if hidden span before */
> span.hidden + form,
> span[style*='display:none'] + form {
margin-left: 0;
} }
/* Inputs inside popover supports text, submit & reset */ /* Inputs inside popover supports text, submit & reset */
input { input {
min-width: 34px; min-width: #{$popoveritem-height - 4px}; /* twice the margin */
max-height: 34px; max-height: #{$popoveritem-height - 4px}; /* twice the margin */
margin: 2px 0; margin: 2px 0;
flex: 1 1 auto; flex: 1 1 auto;
~ input { &:not(:first-child) {
margin-left: 5px; margin-left: 5px;
} }
} }
} }
/* css hack, only first not hidden*/ /* css hack, only first not hidden*/
&:not(.hidden):not([style*='display: none']) { &:not(.hidden):not([style*='display:none']) {
&:first-of-type input { &:first-of-type {
margin-top: 10px; > button, > a, > .menuitem {
> form, > input {
margin-top: 10px;
}
}
} }
&:last-of-type input { &:last-of-type {
margin-bottom: 10px; > button, > a, > .menuitem {
> form, > input {
margin-bottom: 10px;
}
}
} }
} }
> button { > button {