mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Remove ES6 from web components
This commit is contained in:
parent
19eb3fa193
commit
943e9b2899
@ -130,7 +130,7 @@ Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
imageChanged: function (newVal) {
|
imageChanged: function (newVal) {
|
||||||
this.$.badge.style.backgroundImage = newVal ? `url(${newVal})` : '';
|
this.$.badge.style.backgroundImage = newVal ? 'url(' + newVal + ')' : '';
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
@ -68,15 +68,17 @@ Polymer({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
viewTapped() {
|
viewTapped: function () {
|
||||||
this.fire('view-tapped');
|
this.fire('view-tapped');
|
||||||
},
|
},
|
||||||
|
|
||||||
viewSelected(ev) {
|
viewSelected: function (ev) {
|
||||||
var view = ev.detail.item.getAttribute('data-entity') || null;
|
var view = ev.detail.item.getAttribute('data-entity') || null;
|
||||||
var current = this.currentView || null;
|
var current = this.currentView || null;
|
||||||
if (view !== current) {
|
if (view !== current) {
|
||||||
this.async(function () { this.hass.viewActions.selectView(view); }.bind(this), 0);
|
this.async(function () {
|
||||||
|
this.hass.viewActions.selectView(view);
|
||||||
|
}.bind(this), 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -81,7 +81,7 @@ Polymer({
|
|||||||
this.iconsLoaded = true;
|
this.iconsLoaded = true;
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
this.importHref(`/static/mdi-${this.icons}.html`,
|
this.importHref('/static/mdi-' + this.icons + '.html',
|
||||||
success,
|
success,
|
||||||
function () {
|
function () {
|
||||||
this.importHref('/static/mdi.html', success, success);
|
this.importHref('/static/mdi.html', success, success);
|
||||||
|
@ -39,8 +39,8 @@ Polymer({
|
|||||||
if (hass.demo) {
|
if (hass.demo) {
|
||||||
return '/demo/webcam.jpg';
|
return '/demo/webcam.jpg';
|
||||||
} else if (stateObj) {
|
} else if (stateObj) {
|
||||||
return `/api/camera_proxy_stream/${stateObj.entityId}` +
|
return '/api/camera_proxy_stream/' + stateObj.entityId +
|
||||||
`?token=${stateObj.attributes.access_token}`;
|
'?token=' + stateObj.attributes.access_token;
|
||||||
}
|
}
|
||||||
// Return an empty image if no stateObj (= dialog not open)
|
// Return an empty image if no stateObj (= dialog not open)
|
||||||
return 'data:image/gif;base64,R0lGODlhAQABAAAAACw=';
|
return 'data:image/gif;base64,R0lGODlhAQABAAAAACw=';
|
||||||
|
@ -69,7 +69,7 @@ Polymer({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.hass.serviceActions.callService('input_select', 'select_option', {
|
this.hass.serviceActions.callService('input_select', 'select_option', {
|
||||||
option,
|
option: option,
|
||||||
entity_id: this.stateObj.entityId,
|
entity_id: this.stateObj.entityId,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,7 @@ window.hassBehavior = {
|
|||||||
var getter = this.properties[key].bindNuclear(hass);
|
var getter = this.properties[key].bindNuclear(hass);
|
||||||
|
|
||||||
if (!getter) {
|
if (!getter) {
|
||||||
throw new Error(`Undefined getter specified for key ${key}`);
|
throw new Error('Undefined getter specified for key ' + key);
|
||||||
}
|
}
|
||||||
|
|
||||||
this[key] = hass.reactor.evaluate(getter);
|
this[key] = hass.reactor.evaluate(getter);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user