mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-16 07:19:13 +08:00
Add component cleanup to analysis router's vue-helper, add cleanup to tool form's history listener
This commit is contained in:
@@ -165,12 +165,22 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.requestTool();
|
||||
this.requestTool().then(() => {
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel) {
|
||||
console.debug("ToolForm::created - Listening to history changes.");
|
||||
Galaxy.currHistoryPanel.collection.on("change", () => {
|
||||
this.onUpdate();
|
||||
console.debug("ToolForm::created - Loading history changes.");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
const Galaxy = getGalaxyInstance();
|
||||
if (Galaxy && Galaxy.currHistoryPanel) {
|
||||
Galaxy.currHistoryPanel.collection.on("change", () => {
|
||||
this.onUpdate();
|
||||
});
|
||||
Galaxy.currHistoryPanel.collection.off("change");
|
||||
console.debug("ToolForm::beforeDestroy - Stopped listening to history changes.");
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -227,7 +237,7 @@ export default {
|
||||
},
|
||||
requestTool(newVersion) {
|
||||
this.currentVersion = newVersion || this.currentVersion;
|
||||
getToolFormData(this.id, this.currentVersion, this.job_id, this.history_id).then((data) => {
|
||||
return getToolFormData(this.id, this.currentVersion, this.job_id, this.history_id).then((data) => {
|
||||
this.formConfig = data;
|
||||
this.remapAllowed = this.job_id && data.job_remap;
|
||||
this.showLoading = false;
|
||||
|
||||
@@ -125,7 +125,11 @@ export const getAnalysisRouter = (Galaxy) => {
|
||||
}
|
||||
this.page.display(container, noPadding);
|
||||
const mountFn = mountVueComponent(component);
|
||||
return mountFn(propsData, container);
|
||||
if (this.currentComponent && this.currentComponent.$destroy) {
|
||||
this.currentComponent.$destroy();
|
||||
}
|
||||
this.currentComponent = mountFn(propsData, container);
|
||||
return this.currentComponent;
|
||||
},
|
||||
|
||||
show_tours: function (tour_id) {
|
||||
|
||||
Reference in New Issue
Block a user