diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2016-10-12 15:38:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-12 15:38:38 +0200 |
commit | 17fa45a29200ced15b4258f2d06d8159b60856f9 (patch) | |
tree | 02557f5a43a12dca1eccd4b625872a44371917f0 /core/js/sharedialogview.js | |
parent | b2d68c00091f8bcba104cabfe0f7e2c78cc7a8d0 (diff) | |
parent | e6b51cb54c40e887bf39c72f21c6ecaf47ecb265 (diff) | |
download | nextcloud-server-17fa45a29200ced15b4258f2d06d8159b60856f9.tar.gz nextcloud-server-17fa45a29200ced15b4258f2d06d8159b60856f9.zip |
Merge pull request #1704 from nextcloud/avatar_dropdown
[us] Show avatar in share drop down
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 dce4a60bc9a..7efb361f512 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) |