Fixes the share autocomplete scrollbars
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
parent
1f3060eacf
commit
5723f77ef7
|
@ -171,6 +171,14 @@
|
|||
.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;
|
||||
|
|
|
@ -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