moved scroll on top on country selection in charts tab; prevented empty search in frontend
This commit is contained in:
parent
88b51c09ac
commit
370609d284
@ -67,13 +67,19 @@
|
|||||||
</aside>
|
</aside>
|
||||||
<main id="main_content">
|
<main id="main_content">
|
||||||
<div id="middle_section">
|
<div id="middle_section">
|
||||||
<header id="search"><input id="searchbar" autocomplete="off" type="text" name="searchbar" value=""
|
<header id="search">
|
||||||
placeholder="Search..." autofocus></header>
|
<input id="searchbar" autocomplete="off" type="text" name="searchbar" value="" placeholder="Search..."
|
||||||
|
autofocus>
|
||||||
|
</header>
|
||||||
<section id="content">
|
<section id="content">
|
||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="search_tab" class="main_tabcontent">
|
<div id="search_tab" class="main_tabcontent">
|
||||||
<div :class="{'hide': results.query != ''}">
|
<div :class="{'hide': results.query != ''}">
|
||||||
<h2>Start searching!</h2>
|
<h2>Start searching!</h2>
|
||||||
|
<p>
|
||||||
|
You can search a track, a whole album, an artist, a plylist.... everything! You can also paste a
|
||||||
|
Deezer link
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div :class="{'hide': results.query == ''}">
|
<div :class="{'hide': results.query == ''}">
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -30,6 +30,8 @@ const ChartsTab = new Vue({
|
|||||||
QualityModal.open(e.currentTarget.dataset.link)
|
QualityModal.open(e.currentTarget.dataset.link)
|
||||||
},
|
},
|
||||||
getTrackList(e) {
|
getTrackList(e) {
|
||||||
|
document.getElementById('content').scrollTo(0, 0)
|
||||||
|
|
||||||
this.country = e.currentTarget.dataset.title
|
this.country = e.currentTarget.dataset.title
|
||||||
localStorage.setItem('chart', this.country)
|
localStorage.setItem('chart', this.country)
|
||||||
this.id = e.currentTarget.dataset.id
|
this.id = e.currentTarget.dataset.id
|
||||||
|
@ -90,6 +90,7 @@ const MainSearch = new Vue({
|
|||||||
numberWithDots: Utils.numberWithDots,
|
numberWithDots: Utils.numberWithDots,
|
||||||
convertDuration: Utils.convertDuration,
|
convertDuration: Utils.convertDuration,
|
||||||
search(type) {
|
search(type) {
|
||||||
|
console.log('searcho')
|
||||||
socket.emit('search', {
|
socket.emit('search', {
|
||||||
term: this.results.query,
|
term: this.results.query,
|
||||||
type: type,
|
type: type,
|
||||||
|
@ -25,8 +25,11 @@ function handleContentScroll(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleSearchBarKeyup(e) {
|
function handleSearchBarKeyup(e) {
|
||||||
if (e.keyCode == 13) {
|
// Enter key
|
||||||
|
if (e.keyCode !== 13) return
|
||||||
|
|
||||||
let term = this.value
|
let term = this.value
|
||||||
|
|
||||||
if (Utils.isValidURL(term)) {
|
if (Utils.isValidURL(term)) {
|
||||||
if (e.ctrlKey) {
|
if (e.ctrlKey) {
|
||||||
QualityModal.open(term)
|
QualityModal.open(term)
|
||||||
@ -38,7 +41,9 @@ function handleSearchBarKeyup(e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (term != MainSearch.query || main_selected == 'search_tab') {
|
if (term === '') return
|
||||||
|
|
||||||
|
if (term !== MainSearch.results.query || main_selected == 'search_tab') {
|
||||||
document.getElementById('search_tab_content').style.display = 'none'
|
document.getElementById('search_tab_content').style.display = 'none'
|
||||||
socket.emit('mainSearch', { term: term })
|
socket.emit('mainSearch', { term: term })
|
||||||
} else {
|
} else {
|
||||||
@ -46,7 +51,6 @@ function handleSearchBarKeyup(e) {
|
|||||||
document.getElementById('main_search_tablink').click()
|
document.getElementById('main_search_tablink').click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
Loading…
Reference in New Issue
Block a user