[pve-devel] [PATCH pve-manager] reselect the current node after a tree refresh
Emmanuel Kasper
e.kasper at proxmox.com
Thu Mar 10 17:27:03 CET 2016
This patch triggers a not so beautiful flicker of the tab panel, please
ignore I have a better patch on the way.
On 03/10/2016 03:43 PM, Emmanuel Kasper wrote:
> if the selected node has its status changed between stop &
> running, the node is removed and then readded
> during the remove / add process the 'selected' status of the node
> is lost if it has one, so we need to reselect it
>
> this fixes a graphical bug where starting/stopping a VM/container would display
> an empty config panel if this precise node was currently selected
> ---
> www/manager6/tree/ResourceTree.js | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
> index 711a386..df496a4 100644
> --- a/www/manager6/tree/ResourceTree.js
> +++ b/www/manager6/tree/ResourceTree.js
> @@ -303,10 +303,14 @@ Ext.define('PVE.tree.ResourceTree', {
> me.selectById(lastsel.data.id);
> }
>
> + // on first tree load set the selection from the stateful provider
> if (!pdata.updateCount) {
> rootnode.collapse();
> rootnode.expand();
> me.applyState(sp.get(stateid));
> + } else {
> + // if a node status changed (start/stop), we need to force selection
> + me.getSelection()[0] || me.selectById(lastsel.data.id );
> }
>
> pdata.updateCount++;
>
More information about the pve-devel
mailing list