[pve-devel] [PATCH widget-toolkit v3 2/2] rrdchart: use reference for undo button
Aaron Lauterer
a.lauterer at proxmox.com
Tue Jul 15 16:31:57 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>
---
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 3b41ae6..f9a9b33 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