From a87c431428bf9b5030e5b5e5a6a3c154022a3279 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 15 Feb 2017 22:59:08 -0800 Subject: [PATCH] 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. --- src/more-infos/more-info-content.html | 2 +- src/util/hass-util.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/more-infos/more-info-content.html b/src/more-infos/more-info-content.html index 67da253387..0c462bb7d3 100644 --- a/src/more-infos/more-info-content.html +++ b/src/more-infos/more-info-content.html @@ -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 }); } }, diff --git a/src/util/hass-util.html b/src/util/hass-util.html index d5d6bc92d9..a08936bf1f 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -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) {