mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
update
This commit is contained in:
parent
da831893de
commit
e2ce0e38a6
4 changed files with 68 additions and 4 deletions
|
@ -42,6 +42,18 @@ export default {
|
|||
mounted() {
|
||||
this.modal = new Modal(this.$refs.modal);
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
this.cleanupModal();
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.cleanupModal();
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
this.cleanupModal();
|
||||
next();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Show the confirm dialog
|
||||
|
@ -58,6 +70,22 @@ export default {
|
|||
this.$emit("added", this.groupName);
|
||||
this.modal.hide();
|
||||
},
|
||||
/**
|
||||
* Clean up modal and restore scroll behavior
|
||||
* @returns {void}
|
||||
*/
|
||||
cleanupModal() {
|
||||
if (this.modal) {
|
||||
try {
|
||||
this.modal.hide();
|
||||
} catch (e) {
|
||||
console.warn("Modal hide failed:", e);
|
||||
}
|
||||
}
|
||||
document.body.classList.remove('modal-open');
|
||||
document.body.style.paddingRight = '';
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -354,8 +354,11 @@ export default {
|
|||
*/
|
||||
cleanupModal() {
|
||||
if (this.modal) {
|
||||
this.modal.hide();
|
||||
this.modal.dispose();
|
||||
try {
|
||||
this.modal.hide();
|
||||
} catch (e) {
|
||||
console.warn("Modal hide failed:", e);
|
||||
}
|
||||
}
|
||||
document.body.classList.remove('modal-open');
|
||||
document.body.style.paddingRight = '';
|
||||
|
|
|
@ -231,8 +231,11 @@ export default {
|
|||
*/
|
||||
cleanupModal() {
|
||||
if (this.modal) {
|
||||
this.modal.hide();
|
||||
this.modal.dispose();
|
||||
try {
|
||||
this.modal.hide();
|
||||
} catch (e) {
|
||||
console.warn("Modal hide failed:", e);
|
||||
}
|
||||
}
|
||||
document.body.classList.remove('modal-open');
|
||||
document.body.style.paddingRight = '';
|
||||
|
|
|
@ -248,6 +248,20 @@ export default {
|
|||
this.modal = new Modal(this.$refs.modal);
|
||||
this.getExistingTags();
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
this.cleanupModal();
|
||||
next();
|
||||
},
|
||||
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
this.cleanupModal();
|
||||
}
|
||||
},
|
||||
|
||||
beforeUnmount() {
|
||||
this.cleanupModal();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Show the add tag dialog
|
||||
|
@ -459,6 +473,22 @@ export default {
|
|||
this.newTags = [];
|
||||
this.deleteTags = [];
|
||||
this.processing = false;
|
||||
},
|
||||
/**
|
||||
* Clean up modal and restore scroll behavior
|
||||
* @returns {void}
|
||||
*/
|
||||
cleanupModal() {
|
||||
if (this.modal) {
|
||||
try {
|
||||
this.modal.hide();
|
||||
} catch (e) {
|
||||
console.warn("Modal hide failed:", e);
|
||||
}
|
||||
}
|
||||
document.body.classList.remove('modal-open');
|
||||
document.body.style.paddingRight = '';
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue