fix: remove top-bar class on sel manager destruction

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/head
Varun Patil 2023-04-28 22:37:10 -07:00
parent 395b3aacb5
commit 10002e3686
1 changed files with 11 additions and 7 deletions

View File

@ -203,14 +203,13 @@ export default defineComponent({
];
},
beforeDestroy() {
this.setHasTopBar(false);
},
watch: {
show() {
const klass = 'has-top-bar';
if (this.show) {
document.body.classList.add(klass);
} else {
document.body.classList.remove(klass);
}
show(value: boolean) {
this.setHasTopBar(value);
},
},
@ -269,6 +268,11 @@ export default defineComponent({
this.size = this.selection.size;
},
/** Set the has-top-bar class on the body */
setHasTopBar(has: boolean) {
document.body.classList.toggle('has-top-bar', has);
},
/** Is this fileid (or anything if not specified) selected */
has(fileid?: number) {
if (fileid === undefined) {