[pve-devel] [RFC manager 1/3] add tooltip to help button

Dominik Csapak d.csapak at proxmox.com
Wed Sep 14 12:19:28 CEST 2016


with this patch, the help button on the config panels
get a tooltip with the text of the property
onlineHelpTooltip

or when an options has an onlineHelp defined but no
tooltip text, it gets the title of the option
(e.g. Datacenter -> Backup has the Tooltip "Backup")

We want this, to clarify where the help button goes,
without actually clicking

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
is there a better way to signify that on different
options we have different help entry points?

 www/manager6/panel/ConfigPanel.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/www/manager6/panel/ConfigPanel.js b/www/manager6/panel/ConfigPanel.js
index 7e7a773..fe1a7d1 100644
--- a/www/manager6/panel/ConfigPanel.js
+++ b/www/manager6/panel/ConfigPanel.js
@@ -114,6 +114,13 @@ Ext.define('PVE.panel.Config', {
 	    var curcard = me.getLayout().getActiveItem();
 	    var newcard = me.add(me.savedItems[cardid]);
 	    me.helpButton.onlineHelp = newcard.onlineHelp || me.onlineHelp;
+	    var tooltip = '';
+	    if (newcard.onlineHelp) {
+		tooltip = newcard.onlineHelpTooltip || newcard.title;
+	    } else if (me.onlineHelpTooltip) {
+		tooltip = me.onlineHelpTooltip;
+	    }
+	    me.helpButton.setTooltip(tooltip);
 	    if (curcard) {
 		me.setActiveItem(cardid);
 		me.remove(curcard, true);
@@ -178,7 +185,8 @@ Ext.define('PVE.panel.Config', {
 	me.helpButton = Ext.create('PVE.button.Help', {
 	    hidden: false,
 	    listenToGlobalEvent: false,
-	    onlineHelp: me.onlineHelp || undefined
+	    onlineHelp: me.onlineHelp || undefined,
+	    tooltip: me.onlineHelpTooltip
 	});
 
 	tbar.push(me.helpButton);
-- 
2.1.4




More information about the pve-devel mailing list