public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Matthias Heiserer <m.heiserer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 manager] ui: tree-wide: use new AltText button
Date: Mon, 28 Mar 2022 15:07:37 +0200	[thread overview]
Message-ID: <20220328130737.2961451-4-m.heiserer@proxmox.com> (raw)
In-Reply-To: <20220328130737.2961451-1-m.heiserer@proxmox.com>

text is not needed with the AltText button.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
 www/manager6/lxc/Resources.js     | 18 +-----------------
 www/manager6/qemu/HardwareView.js | 18 +-----------------
 2 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index 15ee3c67..96dc43a1 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -189,8 +189,7 @@ Ext.define('PVE.lxc.RessourceView', {
 	    handler: run_resize,
 	});
 
-	var remove_btn = new Proxmox.button.Button({
-	    text: gettext('Remove'),
+	var remove_btn = new Proxmox.button.AltText({
 	    defaultText: gettext('Remove'),
 	    altText: gettext('Detach'),
 	    selModel: me.selModel,
@@ -210,21 +209,6 @@ Ext.define('PVE.lxc.RessourceView', {
 		return msg;
 	    },
 	    handler: run_remove,
-	    listeners: {
-		render: function(btn) {
-		    // hack: calculate the max button width on first display to prevent the whole
-		    // toolbar to move when we switch between the "Remove" and "Detach" labels
-		    let def = btn.getSize().width;
-
-		    btn.setText(btn.altText);
-		    let alt = btn.getSize().width;
-
-		    btn.setText(btn.defaultText);
-
-		    let optimal = alt > def ? alt : def;
-		    btn.setSize({ width: optimal });
-		},
-	    },
 	});
 
 	var move_btn = new Proxmox.button.Button({
diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index 6cea4287..a95da1dc 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -438,8 +438,7 @@ Ext.define('PVE.qemu.HardwareView', {
 	    handler: run_move,
 	});
 
-	var remove_btn = new Proxmox.button.Button({
-	    text: gettext('Remove'),
+	var remove_btn = new Proxmox.button.AltText({
 	    defaultText: gettext('Remove'),
 	    altText: gettext('Detach'),
 	    selModel: sm,
@@ -485,21 +484,6 @@ Ext.define('PVE.qemu.HardwareView', {
 		    },
 		});
 	    },
-	    listeners: {
-		render: function(btn) {
-		    // hack: calculate the max button width on first display to prevent the whole
-		    // toolbar to move when we switch between the "Remove" and "Detach" labels
-		    var def = btn.getSize().width;
-
-		    btn.setText(btn.altText);
-		    var alt = btn.getSize().width;
-
-		    btn.setText(btn.defaultText);
-
-		    var optimal = alt > def ? alt : def;
-		    btn.setSize({ width: optimal });
-		},
-	    },
 	});
 
 	var revert_btn = new PVE.button.PendingRevert({
-- 
2.30.2





  parent reply	other threads:[~2022-03-28 13:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 13:07 [pve-devel] [PATCH v2 widget-toolkit 1/3] Buttons: add AltText Matthias Heiserer
2022-03-28 13:07 ` [pve-devel] [PATCH v2 widget-toolkit 2/3] Makefile: " Matthias Heiserer
2022-03-28 13:07 ` [pve-devel] [PATCH v2 widget-toolkit 3/3] apt repos: use new AltText button Matthias Heiserer
2022-03-28 13:07 ` Matthias Heiserer [this message]
2022-04-07 10:46 ` [pve-devel] [PATCH v2 widget-toolkit 1/3] Buttons: add AltText Dominik Csapak
2022-04-07 10:50 ` Dominik Csapak
2022-04-27 16:55 ` [pve-devel] applied: " 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=20220328130737.2961451-4-m.heiserer@proxmox.com \
    --to=m.heiserer@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal