settings tabs now remember their previous state
This commit is contained in:
parent
988282845f
commit
4dc96056a2
1 changed files with 303 additions and 285 deletions
|
@ -1,6 +1,6 @@
|
|||
<script type="text/x-template" id="cider-settings">
|
||||
<div class="content-inner settings-page">
|
||||
<b-tabs pills fill content-class="mt-3">
|
||||
<b-tabs pills fill content-class="mt-3" v-model="tabIndex">
|
||||
<b-tab :title="$root.getLz('settings.header.general')" active>
|
||||
<div class="md-option-container">
|
||||
<!-- General Settings -->
|
||||
|
@ -1522,10 +1522,28 @@
|
|||
data: function () {
|
||||
return {
|
||||
app: this.$root,
|
||||
themes: ipcRenderer.sendSync("get-themes")
|
||||
themes: ipcRenderer.sendSync("get-themes"),
|
||||
tabIndex: 0,
|
||||
canChangeHash: false
|
||||
}
|
||||
}, watch: {
|
||||
tabIndex: function (val) {
|
||||
if (this.canChangeHash) {
|
||||
window.location.hash = `#settings/${val}`
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.$nextTick(function () {
|
||||
if (window.location.hash.split("/").length > 1) {
|
||||
this.tabIndex = parseInt(window.location.hash.split("/")[1])
|
||||
console.debug("tabIndex", this.tabIndex)
|
||||
this.canChangeHash = true
|
||||
}else{
|
||||
this.canChangeHash = true
|
||||
}
|
||||
})
|
||||
|
||||
if (app.cfg.lastfm.enabled) {
|
||||
const element = document.getElementById('lfmConnect');
|
||||
if (element) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue