From: Morris Jobke Date: Thu, 21 Mar 2013 21:41:44 +0000 (+0100) Subject: share autocomplete - improve group appearance X-Git-Tag: v6.0.0alpha2~982^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a1a6ef940906b93364e682621f095bfbc10ff041;p=nextcloud-server.git share autocomplete - improve group appearance highlight groups with markup (bold font) instead of "(group)" postfix ref owncloud/core#173 --- diff --git a/core/js/share.js b/core/js/share.js index 8e767663f12..36b5f6bdd7a 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -235,7 +235,19 @@ OC.Share={ }); return false; } - }); + }) + // customize internal _renderItem function to display groups and users differently + .data("ui-autocomplete")._renderItem = function( ul, item ) { + var insert = ''; + if(item.label.length > 8 && item.label.substr(item.label.length-8) === ' (group)') { + // current label is group + insert = ' style="font-weight:bold;"'; + item.label = item.label.substring(0, item.label.length-8) + } + return $( "
  • " ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }; } else { html += ''; html += '';