Merge pull request #12923 from nextcloud/fix/12832/share-autocomplete
Fixes the share autocomplete layout
This commit is contained in:
commit
6e91329872
|
@ -171,8 +171,17 @@
|
|||
.ui-autocomplete {
|
||||
&.ui-menu {
|
||||
padding: 0;
|
||||
|
||||
/* scrolling starts from three items,
|
||||
* so hide overflow and scrollbars for a clean layout */
|
||||
&.item-count-1,
|
||||
&.item-count-2 {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.ui-menu-item a {
|
||||
color: var(--color-text-lighter);
|
||||
display: block;
|
||||
padding: 4px 4px 4px 14px;
|
||||
|
||||
&.ui-state-focus, &.ui-state-active {
|
||||
|
|
|
@ -772,7 +772,16 @@
|
|||
event.preventDefault();
|
||||
},
|
||||
source: this.autocompleteHandler,
|
||||
select: this._onSelectRecipient
|
||||
select: this._onSelectRecipient,
|
||||
open: function() {
|
||||
var autocomplete = $(this).autocomplete('widget');
|
||||
var numberOfItems = autocomplete.find('li').size();
|
||||
autocomplete.removeClass('item-count-1');
|
||||
autocomplete.removeClass('item-count-2');
|
||||
if (numberOfItems <= 2) {
|
||||
autocomplete.addClass('item-count-' + numberOfItems);
|
||||
}
|
||||
}
|
||||
}).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem;
|
||||
|
||||
$shareField.on('keydown', null, shareFieldKeydownHandler);
|
||||
|
|
Loading…
Reference in New Issue