1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Change avatar placeholder on sort order change, fixes owncloud#287.

This commit is contained in:
Jan ten Bokkel 2013-12-17 17:07:04 +01:00
parent 38ab10ef3e
commit 8f05a6beca

View File

@ -50,6 +50,7 @@ OC.Contacts = OC.Contacts || {};
// ~30% faster than jQuery.
try {
this.$listelem.get(0).firstElementChild.getElementsByClassName('nametext')[0].innerHTML = escapeHTML(this.displayNames[method]);
this.setThumbnail();
} catch(e) {
var $elem = this.$listelem.find('.nametext').text(escapeHTML(this.displayNames[method]));
$elem.text(escapeHTML(this.displayNames[method]));
@ -1577,7 +1578,7 @@ OC.Contacts = OC.Contacts || {};
Contact.prototype.setThumbnail = function($elem, refresh) {
if(!this.data.thumbnail && !refresh) {
this.getListItemElement().find('.avatar').css('height', '32px');
this.getListItemElement().find('.avatar').imageplaceholder(this.getDisplayName());
this.getListItemElement().find('.avatar').imageplaceholder(this.getDisplayName()[0] || '#');
return;
}
if(!$elem) {