~tiagosh/address-book-app/fix-1234234

« back to all changes in this revision

Viewing changes to src/imports/Ubuntu/Contacts/Contacts.js

  • Committer: Tarmac
  • Author(s): Renato Araujo Oliveira Filho
  • Date: 2013-10-07 19:45:20 UTC
  • mfrom: (87.3.14 fix-1234484)
  • Revision ID: tarmac-20131007194520-97sgbjk25z8pav6i
Optimized contact list expand and collapse animation. Fixes: https://bugs.launchpad.net/bugs/1234484.

Approved by Bill Filler, PS Jenkins bot, Gustavo Pichorim Boiko.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
    return values
25
25
}
 
26
 
 
27
function getAvatar(contact)
 
28
{
 
29
    // use this verbose mode to avoid problems with binding loops
 
30
    var avatarUrl = contactListView.defaultAvatarImageUrl
 
31
 
 
32
    if (!contact) {
 
33
        return avatarUrl
 
34
    }
 
35
 
 
36
    var avatarDetail = contact.detail(ContactDetail.Avatar)
 
37
    if (avatarDetail) {
 
38
        var avatarValue = avatarDetail.value(Avatar.ImageUrl)
 
39
        if (avatarValue != "") {
 
40
            avatarUrl = avatarValue
 
41
        }
 
42
    }
 
43
    return avatarUrl
 
44
}