mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
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:
parent
14ea3e3af4
commit
a87c431428
@ -45,7 +45,7 @@ Polymer({
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
window.hassUtil.dynamicContentUpdater(
|
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 });
|
{ hass: this.hass, stateObj: stateObj, isVisible: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -76,7 +76,7 @@ window.hassUtil.dynamicContentUpdater = function (root, newElementTag, attribute
|
|||||||
var rootEl = Polymer.dom(root);
|
var rootEl = Polymer.dom(root);
|
||||||
var customEl;
|
var customEl;
|
||||||
|
|
||||||
if (rootEl.lastChild && rootEl.lastChild.tagName === newElementTag) {
|
if (rootEl.lastChild && rootEl.lastChild.tagName.toLowerCase() === newElementTag) {
|
||||||
customEl = rootEl.lastChild;
|
customEl = rootEl.lastChild;
|
||||||
} else {
|
} else {
|
||||||
if (rootEl.lastChild) {
|
if (rootEl.lastChild) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user