Return to correct artist tab category when going back
This commit is contained in:
parent
b0d233da28
commit
b5021e12e3
File diff suppressed because one or more lines are too long
@ -50,6 +50,9 @@ const ArtistTab = new Vue({
|
|||||||
changeTab(tab) {
|
changeTab(tab) {
|
||||||
this.currentTab = tab
|
this.currentTab = tab
|
||||||
},
|
},
|
||||||
|
getCurrentTab() {
|
||||||
|
return this.currentTab
|
||||||
|
},
|
||||||
checkNewRelease(date) {
|
checkNewRelease(date) {
|
||||||
let g1 = new Date()
|
let g1 = new Date()
|
||||||
let g2 = new Date(date)
|
let g2 = new Date(date)
|
||||||
@ -65,7 +68,7 @@ const ArtistTab = new Vue({
|
|||||||
this.image = picture_xl
|
this.image = picture_xl
|
||||||
this.type = 'Artist'
|
this.type = 'Artist'
|
||||||
this.link = `https://www.deezer.com/artist/${id}`
|
this.link = `https://www.deezer.com/artist/${id}`
|
||||||
this.currentTab = Object.keys(releases)[0]
|
if (this.currentTab === '') this.currentTab = Object.keys(releases)[0]
|
||||||
this.sortKey = 'release_date'
|
this.sortKey = 'release_date'
|
||||||
this.sortOrder = 'desc'
|
this.sortOrder = 'desc'
|
||||||
this.head = [
|
this.head = [
|
||||||
|
@ -238,6 +238,7 @@ function showTab(type, id, back = false) {
|
|||||||
if (windows_stack.length == 0) {
|
if (windows_stack.length == 0) {
|
||||||
windows_stack.push({ tab: main_selected })
|
windows_stack.push({ tab: main_selected })
|
||||||
} else if (!back) {
|
} else if (!back) {
|
||||||
|
if (currentStack.type === 'artist') currentStack.selected = ArtistTab.getCurrentTab()
|
||||||
windows_stack.push(currentStack)
|
windows_stack.push(currentStack)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,10 +259,12 @@ function backTab() {
|
|||||||
document.getElementById(`main_${main_selected}link`).click()
|
document.getElementById(`main_${main_selected}link`).click()
|
||||||
} else {
|
} else {
|
||||||
// Retrieving tab type and tab id
|
// Retrieving tab type and tab id
|
||||||
let { type, id } = windows_stack.pop()
|
let data = windows_stack.pop()
|
||||||
|
let { type, id } = data
|
||||||
|
|
||||||
if (type === 'artist') {
|
if (type === 'artist') {
|
||||||
ArtistTab.reset()
|
ArtistTab.reset()
|
||||||
|
if (data.selected) ArtistTab.changeTab(data.selected)
|
||||||
} else {
|
} else {
|
||||||
TracklistTab.reset()
|
TracklistTab.reset()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user