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

Commit

Permalink
Merge pull request #120 from maykar/dev
Browse files Browse the repository at this point in the history
Dev to master
  • Loading branch information
Ryan Meek authored May 21, 2019
2 parents 784df29 + 1a116f6 commit 0f91d3e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions compact-custom-header.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "./compact-custom-header-editor.js?v=1.0.4b4";
import "./compact-custom-header-editor.js?v=1.0.4b5";

export const LitElement = Object.getPrototypeOf(
customElements.get("ha-panel-lovelace")
Expand Down Expand Up @@ -372,7 +372,6 @@ if (!customElements.get("compact-custom-header")) {
styleHeader(root, tabContainer, header, view, tabs) {
if (!this.cchConfig.header && !this.editMode) {
header.style.display = "none";
return;
} else if (!this.editMode) {
view.style.marginTop = "-48.5px";
if (view.querySelector("hui-view")) {
Expand Down Expand Up @@ -621,10 +620,14 @@ if (!customElements.get("compact-custom-header")) {

hideTabs(tabContainer, tabs) {
let hidden_tabs = String(this.cchConfig.hide_tabs).length
? String(this.cchConfig.hide_tabs).replace(/\s+/g, "").split(",")
? String(this.cchConfig.hide_tabs)
.replace(/\s+/g, "")
.split(",")
: null;
let shown_tabs = String(this.cchConfig.show_tabs).length
? String(this.cchConfig.show_tabs).replace(/\s+/g, "").split(",")
? String(this.cchConfig.show_tabs)
.replace(/\s+/g, "")
.split(",")
: null;

// Set the tab config source.
Expand Down Expand Up @@ -1156,6 +1159,12 @@ if (!customElements.get("compact-custom-header")) {
}

function click(index) {
if (
(activeTab == 0 && !wrap && left) ||
(activeTab == tabs.length - 1 && !wrap && !left)
) {
return;
}
if (animate == "swipe") {
let _in = left
? `${screen.width / 1.5}px`
Expand Down

0 comments on commit 0f91d3e

Please sign in to comment.