Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
fix for hui-panel-view and button text justification
Browse files Browse the repository at this point in the history
  • Loading branch information
maykar committed Jan 12, 2020
1 parent d4c94d7 commit f4040cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/style-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,15 @@ export const styleHeader = config => {
} else {
buttonElem.shadowRoot.querySelector('.buttonText').innerHTML = config.button_text[button];
}
buttonElem.shadowRoot.querySelector('.buttonText').dir = 'ltr';
if (button == 'menu') {
buttonElem.shadowRoot.querySelector('.buttonText').dir = config.reverse_button_direction ? 'rtl' : 'ltr';
buttonElem.shadowRoot.querySelector('.buttonText').style.textAlign = config.reverse_button_direction
? 'right'
: 'left';
} else {
buttonElem.shadowRoot.querySelector('.buttonText').dir = config.reverse_button_direction ? 'ltr' : 'rtl';
buttonElem.shadowRoot.querySelector('.buttonText').style.textAlign = config.reverse_button_direction
? 'left'
: 'right';
}
buttonElem.shadowRoot.querySelector('iron-icon').style.display = 'none';
buttonElem.style.width = 'auto';
Expand Down
2 changes: 2 additions & 0 deletions src/style-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export const insertStyleTags = config => {
hui-panel-view {
padding-top: 96px;
${config.panel_view_css ? config.panel_view_css : ''}
${config.kiosk_mode || config.hide_header ? `min-height: 100vh;` : ''}
}
hui-view {
padding-top: 100px;
Expand All @@ -198,6 +199,7 @@ export const insertStyleTags = config => {
? 'min-height: calc(100vh - 52px) !important; margin-bottom: -48px;'
: ''
}
${config.kiosk_mode || config.hide_header ? `min-height: 100vh !important;` : ''}
}
`;

Expand Down

0 comments on commit f4040cb

Please sign in to comment.