]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
add tooltip to help button
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 14 Sep 2016 10:19:28 +0000 (12:19 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 14 Sep 2016 11:05:38 +0000 (13:05 +0200)
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@proxmox.com>
www/manager6/panel/ConfigPanel.js

index 7e7a77384b94dab365786090aca2f910fb0acd6e..fe1a7d1af40c8fc1bb4627289ba234838812c76d 100644 (file)
@@ -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);