From 1dceaed1e9d2b3f438fa07ff961333926721cfe6 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 27 Oct 2020 16:20:11 +0100 Subject: [PATCH] ui: DataStorePanel: save active tab statefully so that the last selected tab for datastores will get selected the next time any datastore is selected, even across browser reloads Signed-off-by: Dominik Csapak --- www/DataStorePanel.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/www/DataStorePanel.js b/www/DataStorePanel.js index 059fd3b2..0da94361 100644 --- a/www/DataStorePanel.js +++ b/www/DataStorePanel.js @@ -10,6 +10,25 @@ Ext.define('PBS.DataStorePanel', { }; }, + stateId: 'pbs-datastore-panel', + stateful: true, + + stateEvents: ['tabchange'], + + applyState: function(state) { + let me = this; + if (state.tab !== undefined) { + me.setActiveTab(state.tab); + } + }, + + getState: function() { + let me = this; + return { + tab: me.getActiveTab().getItemId(), + }; + }, + border: false, defaults: { border: false,