summaryrefslogtreecommitdiffstats
path: root/web_src/js/components/ContextPopup.vue
diff options
context:
space:
mode:
authorAndré Jaenisch <Ryuno-Ki@users.noreply.github.com>2022-10-01 16:26:38 +0200
committerGitHub <noreply@github.com>2022-10-01 16:26:38 +0200
commit04e97b83115e7439d43c0ede5fe2d1b50d201c52 (patch)
tree073a20e9377c5197112327afd11d7a6f2cccb268 /web_src/js/components/ContextPopup.vue
parentUpdate Golang deps (#21304) (diff)
downloadforgejo-04e97b83115e7439d43c0ede5fe2d1b50d201c52.tar.xz
forgejo-04e97b83115e7439d43c0ede5fe2d1b50d201c52.zip
Refactor from Vue2 to Vue3 (#20044)
Close #19902
Diffstat (limited to 'web_src/js/components/ContextPopup.vue')
-rw-r--r--web_src/js/components/ContextPopup.vue12
1 files changed, 5 insertions, 7 deletions
diff --git a/web_src/js/components/ContextPopup.vue b/web_src/js/components/ContextPopup.vue
index c176a18659..0b086690a9 100644
--- a/web_src/js/components/ContextPopup.vue
+++ b/web_src/js/components/ContextPopup.vue
@@ -1,5 +1,5 @@
<template>
- <div>
+ <div ref="root">
<div v-if="loading" class="ui active centered inline loader"/>
<div v-if="!loading && issue !== null">
<p><small>{{ issue.repository.full_name }} on {{ createdAt }}</small></p>
@@ -109,15 +109,16 @@ export default {
},
mounted() {
- this.$root.$on('load-context-popup', (data, callback) => {
+ this.$refs.root.addEventListener('us-load-context-popup', (e) => {
+ const data = e.detail;
if (!this.loading && this.issue === null) {
- this.load(data, callback);
+ this.load(data);
}
});
},
methods: {
- load(data, callback) {
+ load(data) {
this.loading = true;
this.i18nErrorMessage = null;
$.get(`${appSubUrl}/${data.owner}/${data.repo}/issues/${data.index}/info`).done((issue) => {
@@ -130,9 +131,6 @@ export default {
}
}).always(() => {
this.loading = false;
- if (callback) {
- this.$nextTick(callback);
- }
});
}
}