From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit 05/11] panel/RRDChart: fix legend/undoZoom
Date: Wed, 26 May 2021 10:58:33 +0200 [thread overview]
Message-ID: <20210526085839.9808-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210526085839.9808-1-d.csapak@proxmox.com>
the legend is by default of type 'sprite', rever to 'dom'
but we now have to unset the '.legend', else on destruction
extjs tries to destroy it twice
also change the onAfterAnimation listener to 'redraw', since
the original event does not exist anymore, add a buffer to it
so that it is not that heavy
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/css/ext6-pmx.css | 5 +++++
src/panel/RRDChart.js | 12 +++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/css/ext6-pmx.css b/src/css/ext6-pmx.css
index 7cedaa9..0c83d8a 100644
--- a/src/css/ext6-pmx.css
+++ b/src/css/ext6-pmx.css
@@ -122,3 +122,8 @@ div.right-aligned {
.x-treelist-pve-nav {
background-color: #f5f5f5;
}
+
+/* fix padding for legend in header */
+.x-legend-inner {
+ padding: 0;
+}
diff --git a/src/panel/RRDChart.js b/src/panel/RRDChart.js
index 49b3ad2..859cb39 100644
--- a/src/panel/RRDChart.js
+++ b/src/panel/RRDChart.js
@@ -121,6 +121,9 @@ Ext.define('Proxmox.widget.RRDChart', {
},
onAfterAnimation: function(chart, eopts) {
+ if (!chart.header || !chart.header.tools) {
+ return;
+ }
// if the undo button is disabled, disable our tool
let ourUndoZoomButton = chart.header.tools[0];
let undoButton = chart.interactions[0].getUndoButton();
@@ -137,10 +140,16 @@ Ext.define('Proxmox.widget.RRDChart', {
},
],
legend: {
+ type: 'dom',
padding: 0,
},
listeners: {
- animationend: 'onAfterAnimation',
+ redraw: {
+ fn: 'onAfterAnimation',
+ options: {
+ buffer: 500,
+ },
+ },
},
constructor: function(config) {
@@ -200,6 +209,7 @@ Ext.define('Proxmox.widget.RRDChart', {
if (me.header && me.legend) {
me.header.padding = '4 9 4';
me.header.add(me.legend);
+ me.legend = undefined;
}
if (!me.noTool) {
--
2.20.1
next prev parent reply other threads:[~2021-05-26 8:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 8:58 [pve-devel] [PATCH widget-toolkit 00/11] fixes/preparation for extjs7.0 Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 01/11] data/ProxmoxProxy: set responseType to undefined for XMLHTTPRequest Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 02/11] Toolkit: set download url for draw containers to '-' Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 03/11] Toolkit: set clearPropertiesOnDestroy to false by default Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 04/11] css: add css changes for treelist Dominik Csapak
2021-05-26 8:58 ` Dominik Csapak [this message]
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 06/11] Toolkit: update overrides for scroll fixes Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 07/11] Toolkit: update focusJump override Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 08/11] Toolkit: remove firefox touchscreen override Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 09/11] Toolkit: remove pie chart fix Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 10/11] Toolkit: remove textarea fix Dominik Csapak
2021-05-26 8:58 ` [pve-devel] [PATCH widget-toolkit 11/11] Toolkit: remove Datepicker fix Dominik Csapak
2021-05-28 8:43 ` [pve-devel] applied: [PATCH widget-toolkit 00/11] fixes/preparation for extjs7.0 Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210526085839.9808-6-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox