mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Save the status of menu bar(collapse/expand) in browser memory
This commit is contained in:
parent
540906b9e3
commit
28bc283f29
1 changed files with 12 additions and 0 deletions
|
@ -118,12 +118,24 @@ export default {
|
||||||
hideText: this.collapsed,
|
hideText: this.collapsed,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.getPreferenceBoolean("menuCollapse", false)) {
|
||||||
|
this.collapsed = true;
|
||||||
|
this.hideText = true;
|
||||||
|
this.collapseText = true;
|
||||||
|
} else {
|
||||||
|
this.collapsed = false;
|
||||||
|
this.hideText = false;
|
||||||
|
this.collapseText = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const { menuCollapsed, toggleCollapsed } = useMenuCollapsed();
|
const { menuCollapsed, toggleCollapsed } = useMenuCollapsed();
|
||||||
return { collapsed: menuCollapsed, toggleCollapsed };
|
return { collapsed: menuCollapsed, toggleCollapsed };
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
collapsed(_collapsed) {
|
collapsed(_collapsed) {
|
||||||
|
this.setPreference("menuCollapse", _collapsed);
|
||||||
if (this.enableAnimations) {
|
if (this.enableAnimations) {
|
||||||
if (_collapsed) {
|
if (_collapsed) {
|
||||||
this.collapseText = true;
|
this.collapseText = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue