diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index e3da0384fa..6588da7d42 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -132,6 +132,24 @@ }); }, + autocompleteRenderItem: function(ul, item) { + var insert = $(""); + var text = item.label; + if (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { + text = text + ' ('+t('core', 'group')+')'; + } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) { + text = text + ' ('+t('core', 'remote')+')'; + } + insert.text(text); + if(item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { + insert = insert.wrapInner(''); + } + return $("
  • ") + .addClass((item.value.shareType === OC.Share.SHARE_TYPE_GROUP) ? 'group' : 'user') + .append(insert) + .appendTo(ul); + }, + render: function() { var baseTemplate = this._getTemplate('base', TEMPLATE_BASE); @@ -155,7 +173,7 @@ expiration: expiration }); } - }); + }).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem; this.resharerInfoView.$el = this.$el.find('.resharerInfoView'); this.resharerInfoView.render();