File tree 3 files changed +4
-10
lines changed
3 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -174,8 +174,6 @@ export class CustomHeader {
174
174
clickElement . dispatchEvent ( new MouseEvent ( 'click' , { bubbles : false , cancelable : false } ) ) ;
175
175
} ;
176
176
[ 'click' , 'touchend' ] . forEach ( evt => listenElement . addEventListener ( evt , clickIt , false ) ) ;
177
- if ( mobile ) {
178
- listenElement . addEventListener ( 'tap' , clickIt , false ) ;
179
- }
177
+ if ( mobile ) listenElement . addEventListener ( 'tap' , clickIt , false ) ;
180
178
}
181
179
}
Original file line number Diff line number Diff line change @@ -44,8 +44,6 @@ console.info(
44
44
`${ header } ${ info } padding-bottom:6px; border-width: 0px 1px 1px 1px;` ,
45
45
) ;
46
46
47
- let haElem = ha_elements ( ) ;
48
-
49
47
const hideHeader = haElem => {
50
48
if ( ! haElem || ! haElem . appHeader ) return ;
51
49
haElem . appHeader . style . display = 'none' ;
@@ -54,7 +52,7 @@ const hideHeader = haElem => {
54
52
if ( ! window . location . href . includes ( 'disable_ch' ) ) hideHeader ( ha_elements ( ) ) ;
55
53
56
54
export const rebuild = ( ) => {
57
- haElem = ha_elements ( ) ;
55
+ const haElem = ha_elements ( ) ;
58
56
if (
59
57
document
60
58
. querySelector ( 'home-assistant' ) !
@@ -169,7 +167,7 @@ export const rebuild = () => {
169
167
} ;
170
168
171
169
const rawConfigObserver = ( ) => {
172
- haElem = ha_elements ( ) ;
170
+ const haElem = ha_elements ( ) ;
173
171
if ( window [ 'customHeaderRebuildMO' ] ) window [ 'customHeaderRebuildMO' ] . disconnect ( ) ;
174
172
if ( window [ 'customHeaderRawConfigExit' ] ) window [ 'customHeaderRawConfigExit' ] . disconnect ( ) ;
175
173
if ( ! haElem || ! haElem . partialPanel ) {
Original file line number Diff line number Diff line change @@ -10,17 +10,16 @@ export const hass = getHass();
10
10
11
11
export const ha_elements = ( ) => {
12
12
const haElem = { } ;
13
+ haElem . hass = getHass ( ) ;
13
14
haElem . lovelace = getLovelace ( ) ;
14
15
haElem . homeAssistant = document . querySelector ( 'home-assistant' ) ;
15
16
haElem . main = haElem . homeAssistant . shadowRoot . querySelector ( 'home-assistant-main' ) . shadowRoot ;
16
- haElem . hass = getHass ( ) ;
17
17
haElem . partialPanel = haElem . main . querySelector ( 'partial-panel-resolver' ) ;
18
18
haElem . panel = haElem . main . querySelector ( 'ha-panel-lovelace' ) ;
19
19
if ( ! haElem . panel ) return ;
20
20
haElem . root = haElem . panel . shadowRoot . querySelector ( 'hui-root' ) ;
21
21
if ( ! haElem . root ) return ;
22
22
haElem . root = haElem . root . shadowRoot ;
23
-
24
23
haElem . tabs = Array . from ( ( haElem . root . querySelector ( 'paper-tabs' ) || haElem . root ) . querySelectorAll ( 'paper-tab' ) ) ;
25
24
haElem . tabContainer = haElem . root . querySelector ( 'paper-tabs' ) ;
26
25
haElem . menu = haElem . root . querySelector ( 'ha-menu-button' ) ;
@@ -38,5 +37,4 @@ export const ha_elements = () => {
38
37
haElem . sidebar . divider = haElem . sidebar . main . querySelector ( 'div.divider' ) ;
39
38
haElem . appHeader = haElem . root . querySelector ( 'app-header' ) ;
40
39
haElem . appLayout = haElem . root . querySelector ( 'ha-app-layout' ) ;
41
- return haElem ;
42
40
} ;
You can’t perform that action at this time.
0 commit comments