diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-12-13 14:07:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-13 14:07:18 +0100 |
commit | 6e913298724b508ae1fb0653b56f43db067d60a5 (patch) | |
tree | 726793b762dfef8081cfb02a79eac35aa0ee86ef /core | |
parent | 7034df7d77dda48971b86cf006b843444f667f4d (diff) | |
parent | 5723f77ef720daf7ae1d5d697472ddf52c7f9f8c (diff) | |
download | nextcloud-server-6e913298724b508ae1fb0653b56f43db067d60a5.tar.gz nextcloud-server-6e913298724b508ae1fb0653b56f43db067d60a5.zip |
Merge pull request #12923 from nextcloud/fix/12832/share-autocomplete
Fixes the share autocomplete layout
Diffstat (limited to 'core')
-rw-r--r-- | core/css/jquery-ui-fixes.scss | 9 | ||||
-rw-r--r-- | core/js/sharedialogview.js | 11 |
2 files changed, 19 insertions, 1 deletions
diff --git a/core/css/jquery-ui-fixes.scss b/core/css/jquery-ui-fixes.scss index eab22e70d62..31714dc34b3 100644 --- a/core/css/jquery-ui-fixes.scss +++ b/core/css/jquery-ui-fixes.scss @@ -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 { diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index e2ef8db90eb..a433570b13d 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -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); |