mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
added store listener to update facade current history model
This commit is contained in:
@@ -15,6 +15,7 @@ import Backbone from "backbone";
|
||||
import CurrentHistoryView from "mvc/history/history-view-edit-current";
|
||||
import { History } from "mvc/history/history-model";
|
||||
import "./HistoryPanelProxy.scss";
|
||||
import store from "store";
|
||||
|
||||
// bypass polling while using the beta panel, skips contents loading
|
||||
const FakeHistoryViewModel = CurrentHistoryView.CurrentHistoryView.extend({
|
||||
@@ -37,6 +38,7 @@ export const HistoryPanelProxy = Backbone.View.extend({
|
||||
|
||||
// fake view of the current history
|
||||
this.historyView = new FakeHistoryViewModel({
|
||||
fakeHistoryViewModel: true,
|
||||
className: `fake ${CurrentHistoryView.CurrentHistoryView.prototype.className} middle`,
|
||||
purgeAllowed: this.allow_user_dataset_purge,
|
||||
linkTarget: "galaxy_main",
|
||||
@@ -59,6 +61,14 @@ export const HistoryPanelProxy = Backbone.View.extend({
|
||||
url: `${Galaxy.user.urlRoot()}/${Galaxy.user.id || "current"}`,
|
||||
});
|
||||
});
|
||||
|
||||
// Watch the store, change the fake history model when it changs
|
||||
store.subscribe(({ type, payload: newId }) => {
|
||||
if (type == "betaHistory/setCurrentHistoryId") {
|
||||
console.log("setCurrentHistoryId", newId);
|
||||
Galaxy.currHistoryPanel.setModel(new History({ id: newId }));
|
||||
}
|
||||
});
|
||||
},
|
||||
render() {
|
||||
// Hack: For now, remove unused "unified-panel" elements until we can
|
||||
|
||||
Reference in New Issue
Block a user