@consuo/web-component-epg
Advanced tools
Comparing version 0.1.0 to 0.1.1
19
index.js
import { update } from "./utils/scheduleService"; | ||
import { ATTTRIBUTES } from "./utils/constants"; | ||
import { isScrolledIntoView } from "./utils/helpers"; | ||
@@ -84,6 +85,16 @@ export class ConsuoEPG extends HTMLElement { | ||
const active = document.querySelector("div[data-active='active'"); | ||
active.scrollIntoView({ | ||
inline: "center", | ||
}); | ||
const active = this.querySelector("div[data-active='active'"); | ||
if (isScrolledIntoView(active)) { | ||
active.scrollIntoView({ | ||
inline: "center", | ||
}); | ||
} else { | ||
window.addEventListener("scroll", () => { | ||
if (isScrolledIntoView(active)) { | ||
active.scrollIntoView({ | ||
inline: "center", | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -90,0 +101,0 @@ |
{ | ||
"name": "@consuo/web-component-epg", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Show a Consuo schedule", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,4 @@ # @consuo/web-component-epg | ||
![Up next Screenshot](epg-screenshot.png) | ||
![EPG Screenshot](epg-screenshot.png) | ||
![EPG progress Screenshot](epg-screenshot-progress.png) | ||
@@ -8,0 +9,0 @@ ## Install |
105836
11
186
69