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>
|
||||
<main id="main_content">
|
||||
<div id="middle_section">
|
||||
<header id="search"><input id="searchbar" autocomplete="off" type="text" name="searchbar" value=""
|
||||
placeholder="Search..." autofocus></header>
|
||||
<header id="search">
|
||||
<input id="searchbar" autocomplete="off" type="text" name="searchbar" value="" placeholder="Search..."
|
||||
autofocus>
|
||||
</header>
|
||||
<section id="content">
|
||||
<div id="container">
|
||||
<div id="search_tab" class="main_tabcontent">
|
||||
<div :class="{'hide': results.query != ''}">
|
||||
<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 :class="{'hide': results.query == ''}">
|
||||
<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)
|
||||
},
|
||||
getTrackList(e) {
|
||||
document.getElementById('content').scrollTo(0, 0)
|
||||
|
||||
this.country = e.currentTarget.dataset.title
|
||||
localStorage.setItem('chart', this.country)
|
||||
this.id = e.currentTarget.dataset.id
|
||||
|
@ -90,6 +90,7 @@ const MainSearch = new Vue({
|
||||
numberWithDots: Utils.numberWithDots,
|
||||
convertDuration: Utils.convertDuration,
|
||||
search(type) {
|
||||
console.log('searcho')
|
||||
socket.emit('search', {
|
||||
term: this.results.query,
|
||||
type: type,
|
||||
|
@ -25,27 +25,31 @@ function handleContentScroll(event) {
|
||||
}
|
||||
|
||||
function handleSearchBarKeyup(e) {
|
||||
if (e.keyCode == 13) {
|
||||
let term = this.value
|
||||
if (Utils.isValidURL(term)) {
|
||||
if (e.ctrlKey) {
|
||||
QualityModal.open(term)
|
||||
} else {
|
||||
if (window.main_selected == 'analyzer_tab') {
|
||||
Tabs.analyzeLink(term)
|
||||
} else {
|
||||
Downloads.sendAddToQueue(term)
|
||||
}
|
||||
}
|
||||
// Enter key
|
||||
if (e.keyCode !== 13) return
|
||||
|
||||
let term = this.value
|
||||
|
||||
if (Utils.isValidURL(term)) {
|
||||
if (e.ctrlKey) {
|
||||
QualityModal.open(term)
|
||||
} else {
|
||||
if (term != MainSearch.query || main_selected == 'search_tab') {
|
||||
document.getElementById('search_tab_content').style.display = 'none'
|
||||
socket.emit('mainSearch', { term: term })
|
||||
if (window.main_selected == 'analyzer_tab') {
|
||||
Tabs.analyzeLink(term)
|
||||
} else {
|
||||
document.getElementById('search_tab_content').style.display = 'block'
|
||||
document.getElementById('main_search_tablink').click()
|
||||
Downloads.sendAddToQueue(term)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (term === '') return
|
||||
|
||||
if (term !== MainSearch.results.query || main_selected == 'search_tab') {
|
||||
document.getElementById('search_tab_content').style.display = 'none'
|
||||
socket.emit('mainSearch', { term: term })
|
||||
} else {
|
||||
document.getElementById('search_tab_content').style.display = 'block'
|
||||
document.getElementById('main_search_tablink').click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user