mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 13:45:21 +00:00
add goBack function
Add function to go a step back in browsing history. Also don't use the anim var in setActiveItem when no old appWindow is defined, as it is undefined in this scope. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
531d05af21
commit
abfdd685df
@ -74,6 +74,20 @@ Ext.define('PVE.Workspace', { statics: {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
goBack: function() {
|
||||||
|
var actions = PVE.Workspace.history.getActions(),
|
||||||
|
lastAction = actions[actions.length - 2];
|
||||||
|
|
||||||
|
var url = '';
|
||||||
|
if(lastAction) {
|
||||||
|
actions.pop();
|
||||||
|
url = lastAction.getUrl();
|
||||||
|
}
|
||||||
|
|
||||||
|
// use loadPage directly so we don't cause new additions to the history
|
||||||
|
PVE.Workspace.loadPage(url);
|
||||||
|
},
|
||||||
|
|
||||||
__setAppWindow: function(comp, dir) {
|
__setAppWindow: function(comp, dir) {
|
||||||
|
|
||||||
var old = PVE.Workspace.appWindow;
|
var old = PVE.Workspace.appWindow;
|
||||||
@ -94,7 +108,7 @@ Ext.define('PVE.Workspace', { statics: {
|
|||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
} else {
|
} else {
|
||||||
Ext.Viewport.setActiveItem(PVE.Workspace.appWindow, anim);
|
Ext.Viewport.setActiveItem(PVE.Workspace.appWindow);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user