share autocomplete - improve group appearance

highlight groups with markup (bold font) instead of "(group)" postfix

ref owncloud/core#173
This commit is contained in:
Morris Jobke 2013-03-21 22:41:44 +01:00
parent 5fbfe977aa
commit a1a6ef9409
1 changed files with 13 additions and 1 deletions

View File

@ -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 $( "<li>" )
.append( $( "<a" + insert + ">" ).text( item.label ) )
.appendTo( ul );
};
} else {
html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Resharing is not allowed')+'" style="width:90%;" disabled="disabled"/>';
html += '</div>';