]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - src/button/HelpButton.js
1 /* help button pointing to an online documentation
2 for components contained in a modal window
4 Ext
.define('Proxmox.button.Help', {
5 extend
: 'Ext.button.Button',
6 xtype
: 'proxmoxHelpButton',
10 // make help button less flashy by styling it like toolbar buttons
11 iconCls
: ' x-btn-icon-el-default-toolbar-small fa fa-question-circle',
12 cls
: 'x-btn-default-toolbar-small proxmox-inline-button',
16 listenToGlobalEvent
: true,
19 xclass
: 'Ext.app.ViewController',
22 proxmoxShowHelp
: 'onProxmoxShowHelp',
23 proxmoxHideHelp
: 'onProxmoxHideHelp',
26 onProxmoxShowHelp: function(helpLink
) {
27 let view
= this.getView();
28 if (view
.listenToGlobalEvent
=== true) {
29 view
.setOnlineHelp(helpLink
);
33 onProxmoxHideHelp: function() {
34 let view
= this.getView();
35 if (view
.listenToGlobalEvent
=== true) {
41 // this sets the link and the tooltip text
42 setOnlineHelp: function(blockid
) {
45 let info
= Proxmox
.Utils
.get_help_info(blockid
);
47 me
.onlineHelp
= blockid
;
48 let title
= info
.title
;
50 title
+= ' - ' + info
.subtitle
;
56 // helper to set the onlineHelp via a config object
57 setHelpConfig: function(config
) {
59 me
.setOnlineHelp(config
.onlineHelp
);
67 docsURI
= Proxmox
.Utils
.get_help_link(me
.onlineHelp
);
73 Ext
.Msg
.alert(gettext('Help'), gettext('No Help available'));
77 initComponent: function() {
83 me
.setOnlineHelp(me
.onlineHelp
); // set tooltip