[SSE] Formula wizard: show help
This commit is contained in:
parent
875ea063fb
commit
c7b79585c9
|
@ -240,6 +240,7 @@ define([
|
|||
|
||||
(new SSE.Views.FormulaWizard({
|
||||
api : this.api,
|
||||
lang : this.appOptions.lang,
|
||||
funcprops: funcprops,
|
||||
props : props,
|
||||
handler : function(dlg, result, settings) {
|
||||
|
|
|
@ -82,9 +82,12 @@ define([
|
|||
this.props = this.options.props;
|
||||
this.funcprops = this.options.funcprops;
|
||||
this.api = this.options.api;
|
||||
this.lang = this.options.lang;
|
||||
|
||||
this._noApply = false;
|
||||
this.args = [];
|
||||
this.repeatedArg = undefined;
|
||||
this.helpUrl = undefined;
|
||||
this.minArgCount = 1;
|
||||
this.maxArgCount = 1;
|
||||
|
||||
|
@ -138,8 +141,7 @@ define([
|
|||
props.name ? $('#formula-wizard-name').html('<b>' + this.textFunction + ': </b>' + props.name) : $('#formula-wizard-name').addClass('hidden');
|
||||
|
||||
this.$window.find('#formula-wizard-help').on('click', function (e) {
|
||||
// me.close();
|
||||
SSE.getController('LeftMenu').getView('LeftMenu').showMenu('file:help', 'Functions\/' + me.funcprops.origin.toLocaleLowerCase() + '.htm');
|
||||
me.showHelp();
|
||||
})
|
||||
}
|
||||
var height = this.panelDesc.outerHeight();
|
||||
|
@ -313,6 +315,37 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
showHelp: function() {
|
||||
if (this.helpUrl==undefined) {
|
||||
if (!this.funcprops || !this.funcprops.origin) {
|
||||
this.helpUrl = null;
|
||||
return;
|
||||
}
|
||||
var me = this,
|
||||
lang = (this.lang) ? this.lang.split(/[\-\_]/)[0] : 'en',
|
||||
url = 'resources/help/' + lang + '/Functions/' + (this.funcprops.origin.toLocaleLowerCase()) + '.htm';
|
||||
|
||||
fetch(url).then(function(response){
|
||||
if ( response.ok ) {
|
||||
me.helpUrl = url;
|
||||
me.showHelp();
|
||||
} else {
|
||||
url = 'resources/help/en/Functions/' + (me.funcprops.origin.toLocaleLowerCase()) + '.htm';
|
||||
fetch(url).then(function(response){
|
||||
if ( response.ok ) {
|
||||
me.helpUrl = url;
|
||||
me.showHelp();
|
||||
} else {
|
||||
me.helpUrl = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (this.helpUrl) {
|
||||
window.open(this.helpUrl);
|
||||
}
|
||||
},
|
||||
|
||||
getSettings: function() {
|
||||
return {};
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue