mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
fix scroll in notfication
This commit is contained in:
parent
45b6c8a91d
commit
da831893de
1 changed files with 19 additions and 9 deletions
|
@ -226,24 +226,20 @@ export default {
|
||||||
this.notification.name = this.getUniqueDefaultName(to);
|
this.notification.name = this.getUniqueDefaultName(to);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
$route(to, from) {
|
$route(to, from) {
|
||||||
if (this.modal) {
|
this.cleanupModal();
|
||||||
this.modal.hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.modal = new Modal(this.$refs.modal);
|
this.modal = new Modal(this.$refs.modal);
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
if (this.modal) {
|
this.cleanupModal();
|
||||||
this.modal.dispose();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
if (this.modal) {
|
this.cleanupModal();
|
||||||
this.modal.hide();
|
|
||||||
}
|
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -350,6 +346,20 @@ export default {
|
||||||
});
|
});
|
||||||
} while (this.$root.notificationList.find(it => it.name === name));
|
} while (this.$root.notificationList.find(it => it.name === name));
|
||||||
return name;
|
return name;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean up modal and restore scroll behavior
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
cleanupModal() {
|
||||||
|
if (this.modal) {
|
||||||
|
this.modal.hide();
|
||||||
|
this.modal.dispose();
|
||||||
|
}
|
||||||
|
document.body.classList.remove('modal-open');
|
||||||
|
document.body.style.paddingRight = '';
|
||||||
|
document.body.style.overflow = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue