This commit is contained in:
Evert Prants 2018-10-08 12:02:07 +03:00
parent 396ab27aaa
commit 0f8a23c434
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -1,11 +1,8 @@
(function () { (function () {
var table = document.querySelector('#ttable') var table = document.getElementById('#ttable')
var input = document.querySelector('#search') var input = document.getElementById('#search')
var audio = document.querySelector('#player') var audio = document.getElementById('#player')
var playing = document.querySelector('#playing') var playing = document.getElementById('#playing')
var next = document.querySelector('#player-next')
var prev = document.querySelector('#player-prev')
var tableHead = '<tr> \ var tableHead = '<tr> \
<th class="small">#</th> \ <th class="small">#</th> \
@ -156,11 +153,11 @@
play(nowPlaying + 1) play(nowPlaying + 1)
}) })
next.addEventListener('click', function (e) { document.getElementById('player-next').addEventListener('click', function (e) {
play(nowPlaying + 1) play(nowPlaying + 1)
}) })
prev.addEventListener('click', function (e) { document.getElementById('player-prev').addEventListener('click', function (e) {
play(nowPlaying - 1) play(nowPlaying - 1)
}) })
@ -180,8 +177,6 @@
showTracks(pages) showTracks(pages)
}, false) }, false)
showTracks(1)
function handleHash (hash) { function handleHash (hash) {
if (hash.indexOf('#') === 0) hash = hash.substr(1) if (hash.indexOf('#') === 0) hash = hash.substr(1)
if (hash.length === 0) return if (hash.length === 0) return
@ -199,5 +194,6 @@
handleHash(window.location.hash) handleHash(window.location.hash)
}, false) }, false)
showTracks(1)
handleHash(window.location.hash) handleHash(window.location.hash)
})() })()