mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-30 09:52:30 +00:00

This help button is meant to be added on InputPanels, where a link to an online documentation chapter or subschapter is available. Clicking on the help button will open the help in a new browser tab. Original idea similar to the pfSense GUI.
30 lines
720 B
JavaScript
30 lines
720 B
JavaScript
/* help button pointing to an online documentation
|
|
for components contained in a modal window
|
|
*/
|
|
Ext.define('PVE.button.Help', {
|
|
extend: 'Ext.button.Button',
|
|
alias: 'widget.pveHelpButton',
|
|
text: gettext('Help'),
|
|
iconCls: 'fa fa-question-circle',
|
|
hidden: true,
|
|
controller: {
|
|
xclass: 'Ext.app.ViewController',
|
|
listen: {
|
|
global: {
|
|
pveShowHelp: 'onPveShowHelp',
|
|
pveHideHelp: 'onPveHideHelp'
|
|
}
|
|
},
|
|
onPveShowHelp: function(helpLink) {
|
|
this.getView().setHandler(function() {
|
|
var docsURI = window.location.origin +
|
|
'/pve-docs/' + helpLink;
|
|
window.open(docsURI);
|
|
});
|
|
this.getView().show();
|
|
},
|
|
onPveHideHelp: function() {
|
|
this.getView().hide();
|
|
}
|
|
}
|
|
}); |