[pve-devel] [PATCH widget-toolkit v4 2/4] rrdchart: use reference for undo button

Aaron Lauterer a.lauterer at proxmox.com
Sat Jul 26 03:06:02 CEST 2025


This makes targeting the undo button more stable in situations where it
might not be the 0 indexed item in the tools.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/panel/RRDChart.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/panel/RRDChart.js b/src/panel/RRDChart.js
index 8df6a69..35bc186 100644
--- a/src/panel/RRDChart.js
+++ b/src/panel/RRDChart.js
@@ -152,7 +152,7 @@ Ext.define('Proxmox.widget.RRDChart', {
                 return;
             }
             // if the undo button is disabled, disable our tool
-            let ourUndoZoomButton = chart.header.tools[0];
+            let ourUndoZoomButton = chart.lookupReference('undoButton');
             let undoButton = chart.interactions[0].getUndoButton();
             ourUndoZoomButton.setDisabled(undoButton.isDisabled());
         },
@@ -269,6 +269,7 @@ Ext.define('Proxmox.widget.RRDChart', {
             me.addTool({
                 type: 'minus',
                 disabled: true,
+                reference: 'undoButton',
                 tooltip: gettext('Undo Zoom'),
                 handler: function () {
                     let undoButton = me.interactions[0].getUndoButton();
-- 
2.39.5





More information about the pve-devel mailing list