]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: DataStorePanel: save active tab statefully
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 27 Oct 2020 15:20:11 +0000 (16:20 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Oct 2020 16:41:30 +0000 (17:41 +0100)
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 <d.csapak@proxmox.com>
www/DataStorePanel.js

index 059fd3b2c1a1beac802f1df63f8d680fd0cf5bae..0da943611c880a811fc78999397366e484f566a3 100644 (file)
@@ -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,