diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-12 12:17:15 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:27 +0200 |
commit | 4c702aa8fdfb28bea4b021e55e7df5eeeb6999d2 (patch) | |
tree | 0fbec4dc3b59e27a427937aee7e86f137c4b2443 | |
parent | 5fad379bf1ba0bc6502055ba92869663b36c9a84 (diff) | |
download | nextcloud-server-4c702aa8fdfb28bea4b021e55e7df5eeeb6999d2.tar.gz nextcloud-server-4c702aa8fdfb28bea4b021e55e7df5eeeb6999d2.zip |
format groups and remotes in autocomplete list
-rw-r--r-- | core/js/sharedialogview.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index e3da0384fa4..6588da7d429 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -132,6 +132,24 @@ }); }, + autocompleteRenderItem: function(ul, item) { + var insert = $("<a>"); + 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('<strong></strong>'); + } + return $("<li>") + .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(); |