diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-10-06 17:12:10 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-11 15:53:27 +0200 |
commit | e6b51cb54c40e887bf39c72f21c6ecaf47ecb265 (patch) | |
tree | 6bad5e38de4c122a4ebdaa7be5adcf26c31c2f72 /core/js/sharedialogview.js | |
parent | 9785343d6ac879b5e150b128f97b82e788a2df09 (diff) | |
download | nextcloud-server-e6b51cb54c40e887bf39c72f21c6ecaf47ecb265.tar.gz nextcloud-server-e6b51cb54c40e887bf39c72f21c6ecaf47ecb265.zip |
[9.2] Show avatar in share drop down (#25976)
* Show avatar in share drop down
* Fix share autocomplete vertical align with avatar
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/js/sharedialogview.js')
-rw-r--r-- | core/js/sharedialogview.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 2c60f216ef9..2bcd1fdb241 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -251,7 +251,7 @@ }, autocompleteRenderItem: function(ul, item) { - var insert = $("<a>"); + var text = item.label; if (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { text = t('core', '{sharee} (group)', { @@ -269,15 +269,20 @@ }); } } - insert.text(text); - insert.attr('title', item.value.shareWith); - if(item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { - insert = insert.wrapInner('<strong></strong>'); + var insert = $("<div class='share-autocomplete-item'/>"); + var avatar = $("<div class='avatardiv'></div>").appendTo(insert); + if (item.value.shareType === OC.Share.SHARE_TYPE_USER) { + avatar.avatar(item.value.shareWith, 32, undefined, undefined, undefined, item.label); + } else { + avatar.imageplaceholder(text, undefined, 32); } - insert.tooltip({ - placement: 'bottom', - container: 'body' - }); + + $("<div class='autocomplete-item-text'></div>") + .text(text) + .appendTo(insert); + insert.attr('title', item.value.shareWith); + insert = $("<a>") + .append(insert); return $("<li>") .addClass((item.value.shareType === OC.Share.SHARE_TYPE_GROUP) ? 'group' : 'user') .append(insert) |