[Minor] Propagate for to paper-badge

This commit is contained in:
Robert von Burg 2022-04-21 11:45:43 +02:00
parent 69e8c9c677
commit 6e4fab9395
2 changed files with 9 additions and 8 deletions

View File

@ -1,7 +1,7 @@
{
"name": "strolch-wc-badge",
"description": "Strolch WebComponent Badge",
"version": "0.1.2",
"version": "0.1.3",
"authors": [
"Robert von Burg"
],

View File

@ -25,7 +25,7 @@
</style>
<!-- Content -->
<paper-badge id="badge" label="[[label]]"></paper-badge>
<paper-badge id="badge" label="[[label]]" for="[[for]]"></paper-badge>
</template>
<script>
@ -40,6 +40,9 @@
<!-- Properties -->
properties: {
for: {
type: String
},
hide: {
type: Boolean,
observer: "observeHide"
@ -65,13 +68,11 @@
// show this element before the animation is started
this.hidden = false;
// animated to show this badge
if(newValue == false) {
this.playAnimation("show");
}
// animated to hide this badge
else {
// animated to show/hide this badge
if(newValue) {
this.playAnimation("hide");
} else {
this.playAnimation("show");
}
},