mirror of
https://github.com/urbanguacamole/torrent-paradise
synced 2024-10-31 21:20:13 +00:00
81bb90c141
Closes #6.
26 lines
644 B
JavaScript
26 lines
644 B
JavaScript
app = new Vue({
|
|
el: '#app',
|
|
data: { showsearchbox: false, error: "", resultPage: "", resultPageHeight: 1, entries: -1 }
|
|
})
|
|
window.addEventListener("message", receiveMessage, false);
|
|
|
|
function receiveMessage(event) {
|
|
app.resultPageHeight = event.data
|
|
}
|
|
|
|
const searchbox = document.getElementById('searchbox')
|
|
if (searchbox != null) {
|
|
searchbox.onkeydown = function (event) {
|
|
if (event.keyCode == 13) {
|
|
searchTriggered()
|
|
}
|
|
}
|
|
}
|
|
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
const query = urlParams.get('q');
|
|
if (query != null) {
|
|
searchbox.value = query
|
|
searchTriggered()
|
|
}
|