make more-info- tags in dynamicContentUpdater lowercase (#211)

When trying to understand the source tree using `git grep` the fact
that the critical function which actually creates the more-info-
panels used MORE-INFO, makes it actually hard to find. Rework the
logic so that it's all managed in lower case for greater
discoverability of hunting through code.

Because the stateMoreInfoType comes from home-assistant domains, this
should always be lower case, so no explicit lower casing is needed.
This commit is contained in:
Sean Dague 2017-02-15 22:59:08 -08:00 committed by Paulus Schoutsen
parent 14ea3e3af4
commit a87c431428
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ Polymer({
}
} else {
window.hassUtil.dynamicContentUpdater(
this, 'MORE-INFO-' + window.hassUtil.stateMoreInfoType(stateObj).toUpperCase(),
this, 'more-info-' + window.hassUtil.stateMoreInfoType(stateObj),
{ hass: this.hass, stateObj: stateObj, isVisible: true });
}
},

View File

@ -76,7 +76,7 @@ window.hassUtil.dynamicContentUpdater = function (root, newElementTag, attribute
var rootEl = Polymer.dom(root);
var customEl;
if (rootEl.lastChild && rootEl.lastChild.tagName === newElementTag) {
if (rootEl.lastChild && rootEl.lastChild.tagName.toLowerCase() === newElementTag) {
customEl = rootEl.lastChild;
} else {
if (rootEl.lastChild) {