remove duplicate code

This commit is contained in:
mohit-nagaraj 2024-10-08 19:09:21 +05:30
parent 0d2b380f44
commit 95a9e0a096
No known key found for this signature in database
4 changed files with 0 additions and 46 deletions

View file

@ -33,21 +33,12 @@
import { Modal } from "bootstrap"; import { Modal } from "bootstrap";
export default { export default {
beforeRouteLeave(to, from, next) {
this.cleanupModal();
next();
},
props: {}, props: {},
emits: [ "added" ], emits: [ "added" ],
data: () => ({ data: () => ({
modal: null, modal: null,
groupName: null, groupName: null,
}), }),
watch: {
$route(to, from) {
this.cleanupModal();
}
},
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
@ -82,9 +73,6 @@ export default {
console.warn("Modal hide failed:", e); console.warn("Modal hide failed:", e);
} }
} }
document.body.classList.remove("modal-open");
document.body.style.paddingRight = "";
document.body.style.overflow = "";
} }
}, },
}; };

View file

@ -80,10 +80,6 @@ export default {
components: { components: {
Confirm, Confirm,
}, },
beforeRouteLeave(to, from, next) {
this.cleanupModal();
next();
},
props: {}, props: {},
emits: [ "added" ], emits: [ "added" ],
data() { data() {
@ -230,9 +226,6 @@ export default {
this.notification.name = this.getUniqueDefaultName(to); this.notification.name = this.getUniqueDefaultName(to);
} }
}, },
$route(to, from) {
this.cleanupModal();
}
}, },
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
@ -358,9 +351,6 @@ export default {
console.warn("Modal hide failed:", e); console.warn("Modal hide failed:", e);
} }
} }
document.body.classList.remove("modal-open");
document.body.style.paddingRight = "";
document.body.style.overflow = "";
} }
}, },
}; };

View file

@ -105,10 +105,6 @@ export default {
components: { components: {
Confirm, Confirm,
}, },
beforeRouteLeave(to, from, next) {
this.cleanupModal();
next();
},
props: {}, props: {},
emits: [ "added" ], emits: [ "added" ],
data() { data() {
@ -129,11 +125,6 @@ export default {
} }
}; };
}, },
watch: {
$route(to, from) {
this.cleanupModal();
}
},
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
}, },
@ -232,9 +223,6 @@ export default {
console.warn("Modal hide failed:", e); console.warn("Modal hide failed:", e);
} }
} }
document.body.classList.remove("modal-open");
document.body.style.paddingRight = "";
document.body.style.overflow = "";
} }
}, },
}; };

View file

@ -155,10 +155,6 @@ export default {
Tag, Tag,
VueMultiselect, VueMultiselect,
}, },
beforeRouteLeave(to, from, next) {
this.cleanupModal();
next();
},
props: { props: {
/** /**
* Array of tags to be pre-selected * Array of tags to be pre-selected
@ -248,11 +244,6 @@ export default {
}; };
}, },
}, },
watch: {
$route(to, from) {
this.cleanupModal();
}
},
mounted() { mounted() {
this.modal = new Modal(this.$refs.modal); this.modal = new Modal(this.$refs.modal);
this.getExistingTags(); this.getExistingTags();
@ -484,9 +475,6 @@ export default {
console.warn("Modal hide failed:", e); console.warn("Modal hide failed:", e);
} }
} }
document.body.classList.remove("modal-open");
document.body.style.paddingRight = "";
document.body.style.overflow = "";
} }
}, },
}; };