mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 05:46:35 +00:00
Map marker show abbreviated name
This commit is contained in:
parent
be2312de03
commit
431680a012
@ -30,6 +30,7 @@
|
||||
<template is='dom-if' if='[[icon]]'>
|
||||
<iron-icon icon='[[icon]]'></iron-icon>
|
||||
</template>
|
||||
<template is='dom-if' if='[[value]]'>[[value]]</template>
|
||||
<template is='dom-if' if='[[image]]'>
|
||||
<iron-image sizing='cover' class='fit'src='[[image]]'></iron-image>
|
||||
</template>
|
||||
|
@ -31,6 +31,11 @@ export default new Polymer({
|
||||
type: Object,
|
||||
computed: 'computeImage(state)',
|
||||
},
|
||||
|
||||
value: {
|
||||
type: String,
|
||||
computed: 'computeValue(state)',
|
||||
},
|
||||
},
|
||||
|
||||
listeners: {
|
||||
@ -49,13 +54,15 @@ export default new Polymer({
|
||||
},
|
||||
|
||||
computeIcon(state) {
|
||||
return state ?
|
||||
!state.attributes.entity_picture && domainIcon(state.domain) :
|
||||
'home';
|
||||
return !state && 'home';
|
||||
},
|
||||
|
||||
computeImage(state) {
|
||||
return state && state.attributes.entity_picture;
|
||||
},
|
||||
|
||||
computeValue(state) {
|
||||
return state &&
|
||||
state.entityDisplay.split(' ').map(part => part.substr(0, 1)).join('');
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user