mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 22:36: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]]'>
|
<template is='dom-if' if='[[icon]]'>
|
||||||
<iron-icon icon='[[icon]]'></iron-icon>
|
<iron-icon icon='[[icon]]'></iron-icon>
|
||||||
</template>
|
</template>
|
||||||
|
<template is='dom-if' if='[[value]]'>[[value]]</template>
|
||||||
<template is='dom-if' if='[[image]]'>
|
<template is='dom-if' if='[[image]]'>
|
||||||
<iron-image sizing='cover' class='fit'src='[[image]]'></iron-image>
|
<iron-image sizing='cover' class='fit'src='[[image]]'></iron-image>
|
||||||
</template>
|
</template>
|
||||||
|
@ -31,6 +31,11 @@ export default new Polymer({
|
|||||||
type: Object,
|
type: Object,
|
||||||
computed: 'computeImage(state)',
|
computed: 'computeImage(state)',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
computed: 'computeValue(state)',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
listeners: {
|
listeners: {
|
||||||
@ -49,13 +54,15 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
computeIcon(state) {
|
computeIcon(state) {
|
||||||
return state ?
|
return !state && 'home';
|
||||||
!state.attributes.entity_picture && domainIcon(state.domain) :
|
|
||||||
'home';
|
|
||||||
},
|
},
|
||||||
|
|
||||||
computeImage(state) {
|
computeImage(state) {
|
||||||
return state && state.attributes.entity_picture;
|
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