Remove ES6 from web components

pull/67/head
Paulus Schoutsen 2016-06-11 23:55:43 -07:00
parent 19eb3fa193
commit 943e9b2899
6 changed files with 11 additions and 9 deletions

View File

@ -130,7 +130,7 @@ Polymer({
},
imageChanged: function (newVal) {
this.$.badge.style.backgroundImage = newVal ? `url(${newVal})` : '';
this.$.badge.style.backgroundImage = newVal ? 'url(' + newVal + ')' : '';
},
});
</script>

View File

@ -68,15 +68,17 @@ Polymer({
},
},
viewTapped() {
viewTapped: function () {
this.fire('view-tapped');
},
viewSelected(ev) {
viewSelected: function (ev) {
var view = ev.detail.item.getAttribute('data-entity') || null;
var current = this.currentView || null;
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);
}
},
});

View File

@ -81,7 +81,7 @@ Polymer({
this.iconsLoaded = true;
}.bind(this);
this.importHref(`/static/mdi-${this.icons}.html`,
this.importHref('/static/mdi-' + this.icons + '.html',
success,
function () {
this.importHref('/static/mdi.html', success, success);

View File

@ -39,8 +39,8 @@ Polymer({
if (hass.demo) {
return '/demo/webcam.jpg';
} else if (stateObj) {
return `/api/camera_proxy_stream/${stateObj.entityId}` +
`?token=${stateObj.attributes.access_token}`;
return '/api/camera_proxy_stream/' + stateObj.entityId +
'?token=' + stateObj.attributes.access_token;
}
// Return an empty image if no stateObj (= dialog not open)
return 'data:image/gif;base64,R0lGODlhAQABAAAAACw=';

View File

@ -69,7 +69,7 @@ Polymer({
return;
}
this.hass.serviceActions.callService('input_select', 'select_option', {
option,
option: option,
entity_id: this.stateObj.entityId,
});
},

View File

@ -16,7 +16,7 @@ window.hassBehavior = {
var getter = this.properties[key].bindNuclear(hass);
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);