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: { watch: {
show() { show(value: boolean) {
const klass = 'has-top-bar'; this.setHasTopBar(value);
if (this.show) {
document.body.classList.add(klass);
} else {
document.body.classList.remove(klass);
}
}, },
}, },
@ -269,6 +268,11 @@ export default defineComponent({
this.size = this.selection.size; 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 */ /** Is this fileid (or anything if not specified) selected */
has(fileid?: number) { has(fileid?: number) {
if (fileid === undefined) { if (fileid === undefined) {