added loading placeholder when searching; added loading placeholder when changing tabs in search tab

This commit is contained in:
Roberto Tonino
2020-06-18 20:06:14 +02:00
parent e429b9e978
commit 04c127dd6c
12 changed files with 133 additions and 83 deletions

View File

@@ -61,8 +61,6 @@ const FavoritesTab = new Vue({
this.artists = artists
this.playlists = playlists
console.log('update ok')
// Removing animation class only when the animation has completed an iteration
// Prevents animation ugly stutter
this.$refs.reloadButton.addEventListener(

View File

@@ -131,6 +131,10 @@ const MainSearch = new Vue({
}
},
handleMainSearch(result) {
// Hiding loading placeholder
document.getElementById('content').style.display = ''
document.getElementById('search_placeholder').classList.toggle('loading_placeholder--hidden')
let resetObj = { data: [], next: 0, total: 0, loaded: false }
this.results.allTab = result

View File

@@ -46,6 +46,10 @@ function handleSearchBarKeyup(e) {
if (term !== MainSearch.results.query || main_selected == 'search_tab') {
document.getElementById('search_tab_content').style.display = 'none'
socket.emit('mainSearch', { term })
// Showing loading placeholder
document.getElementById('content').style.display = 'none'
document.getElementById('search_placeholder').classList.toggle('loading_placeholder--hidden')
} else {
document.getElementById('search_tab_content').style.display = 'block'
document.getElementById('main_search_tablink').click()

View File

@@ -1,5 +1,5 @@
export const socket = io.connect(window.location.href)
socket.on('connect', () => {
document.getElementById('loading_overlay').classList.remove('active')
document.getElementById('start_app_placeholder').classList.add('loading_placeholder--hidden')
})