Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Fix some const/let vars
Browse files Browse the repository at this point in the history
  • Loading branch information
maykar authored Nov 6, 2020
1 parent e8a2c27 commit 1b98a06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions swipe-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function swipeNavigation() {
const appLayout = root.shadowRoot.querySelector("ha-app-layout");
const view = appLayout.querySelector('[id="view"]');
const tabContainer = appLayout.querySelector("paper-tabs") || appLayout.querySelector("ha-tabs");
const tabs = tabContainer ? Array.from(tabContainer.querySelectorAll("paper-tab")) : [];
let tabs = tabContainer ? Array.from(tabContainer.querySelectorAll("paper-tab")) : [];
const rtl = ha.style.direction == "rtl";
const config = ll.lovelace.config.swipe_nav || {};

Expand Down Expand Up @@ -102,8 +102,8 @@ function swipeNavigation() {
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` : `-${screen.width / 1.5}px`;
let _out = left ? `-${screen.width / 1.5}px` : `${screen.width / 1.5}px`;
const _in = left ? `${screen.width / 1.5}px` : `-${screen.width / 1.5}px`;
const _out = left ? `-${screen.width / 1.5}px` : `${screen.width / 1.5}px`;
view.style.transitionDuration = "200ms";
view.style.opacity = 0;
view.style.transform = `translate(${_in}, 0)`;
Expand Down

0 comments on commit 1b98a06

Please sign in to comment.