Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilujD committed Jan 19, 2017
2 parents 5fee2a0 + 4f0457d commit e62490c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paper-avatar",
"version": "1.1.1",
"version": "1.2.0",
"description": "A simple avatar using the paper-fab style",
"homepage": "https://neilujd.github.io/paper-avatar",
"authors": [
Expand Down
9 changes: 9 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,14 @@ <h3>paper-avatar with specific image sizing</h3>
</template>
</demo-snippet>
</div>

<div class="vertical-section-container centered">
<h3>paper-avatar with label</h3>
<demo-snippet>
<template>
<paper-avatar label="N"></paper-avatar>
</template>
</demo-snippet>
</div>
</body>
</html>
10 changes: 5 additions & 5 deletions paper-avatar.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

<iron-icon
id="icon"
hidden$="{{!_computeIsIconFab(icon, iconSrc)}}"
hidden$="{{!_computeIsIconFab(icon, iconSrc, label)}}"
src="[[iconSrc]]"
icon="[[icon]]"></iron-icon>
<iron-image
Expand All @@ -135,7 +135,7 @@
preload
sizing="[[imageSizing]]"
fade></iron-image>
<span hidden$="{{_computeIsIconFab(icon, iconSrc)}}">{{label}}</span>
<span hidden$="{{_computeIsIconFab(icon, iconSrc, label)}}">{{label}}</span>
</template>

<script>
Expand Down Expand Up @@ -197,7 +197,7 @@
*/
label: {
type: String,
observer: '_labelChanged'
observer: "_labelChanged"
},

/**
Expand All @@ -212,8 +212,8 @@
this.setAttribute('aria-label', this.label);
},

_computeIsIconFab: function(icon, src) {
return (icon.length > 0) || (src.length > 0);
_computeIsIconFab: function(icon, src, label) {
return !label && ((icon.length > 0) || (src.length > 0));
}
});
</script>
Expand Down

0 comments on commit e62490c

Please sign in to comment.