mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-12 10:00:07 -04:00
Update ChannelItem.svelte
This commit is contained in:
parent
5151d89db5
commit
5f3f614830
1 changed files with 3 additions and 12 deletions
|
@ -10,13 +10,14 @@
|
||||||
const guides = channel._guides
|
const guides = channel._guides
|
||||||
const streams = channel._streams
|
const streams = channel._streams
|
||||||
|
|
||||||
const currLocation = window.location.href
|
let currLocation
|
||||||
const { open } = getContext('simple-modal')
|
const { open } = getContext('simple-modal')
|
||||||
const onOpened = () => {
|
const onOpened = () => {
|
||||||
|
currLocation = window.location.href
|
||||||
window.history.pushState({}, `${channel.name} • iptv-org`, `/channel?id=${channel.id}`)
|
window.history.pushState({}, `${channel.name} • iptv-org`, `/channel?id=${channel.id}`)
|
||||||
}
|
}
|
||||||
const onClosed = () => {
|
const onClosed = () => {
|
||||||
window.history.pushState({}, `iptv-org`, currLocation)
|
window.history.pushState({}, `iptv-org`, currLocation || '/')
|
||||||
}
|
}
|
||||||
const showGuides = () =>
|
const showGuides = () =>
|
||||||
open(
|
open(
|
||||||
|
@ -42,16 +43,6 @@
|
||||||
function pluralize(number, word) {
|
function pluralize(number, word) {
|
||||||
return number > 1 ? word + 's' : word
|
return number > 1 ? word + 's' : word
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchBy(q) {
|
|
||||||
if ($query !== q) {
|
|
||||||
query.set(q)
|
|
||||||
hasQuery.set(true)
|
|
||||||
search(q)
|
|
||||||
setSearchParam('q', q)
|
|
||||||
}
|
|
||||||
close()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<tr
|
<tr
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue