mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-05-03 04:59:14 -04:00
Import files from Yawim
This commit is contained in:
parent
370003835e
commit
dd4809f519
18 changed files with 994 additions and 116 deletions
43
app/elements/buddy-finder/user-avatar.html
Normal file
43
app/elements/buddy-finder/user-avatar.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<link rel="import" href="../contact-item/anonymous-contact-behavior.html">
|
||||
<dom-module id="user-avatar">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
@apply(--layout-vertical);
|
||||
@apply(--layout-center);
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: inline-block;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
background: #ccc;
|
||||
@apply(--shadow-elevation-2dp);
|
||||
}
|
||||
.paper-font-subhead{
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<div class="avatar" id="avatar" item-icon></div>
|
||||
<div class="paper-font-subhead">{{_displayName}}</div>
|
||||
</template>
|
||||
<script>
|
||||
'use strict';
|
||||
Polymer({
|
||||
is: 'user-avatar',
|
||||
behaviors:[Chat.AnonymousContactBehavior],
|
||||
observers:['_computeBackgroundImg(contact.*)'],
|
||||
_computeBackgroundImg:function(){
|
||||
console.log('avatar changed');
|
||||
var avatar = this.anonymousAccount(this.contact).avatar;
|
||||
var style = this.$.avatar.style;
|
||||
style.backgroundImage='url('+avatar.url+')';
|
||||
style.backgroundPosition=avatar.left+'px '+avatar.top+'px';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
Loading…
Add table
Add a link
Reference in a new issue