[SSE] Show specified formula group

This commit is contained in:
Julia Radzhabova 2019-06-25 10:39:09 +03:00
parent 164e295be2
commit a94a30362b
3 changed files with 12 additions and 14 deletions

View file

@ -86,10 +86,10 @@ define([
});
},
applyFunction: function(func, autocomplete) {
applyFunction: function(func, autocomplete, group) {
if (func) {
if (func.origin === 'more') {
this.showDialog();
this.showDialog(group);
} else {
this.api.asc_insertFormula(func.name, Asc.c_oAscPopUpSelectorType.Func, !!autocomplete);
!autocomplete && this.updateLast10Formulas(func.origin);
@ -202,7 +202,7 @@ define([
return null;
},
showDialog: function () {
showDialog: function (group) {
if (this.formulas) {
if ( this.needUpdateFormula ) {
this.needUpdateFormula = false;
@ -211,7 +211,7 @@ define([
this.formulas.fillFormulasGroups();
}
}
this.formulas.show();
this.formulas.show(group);
}
},
hideDialog: function () {

View file

@ -104,7 +104,7 @@ define([
this.descLabel = $('#formula-dlg-desc');
this.fillFormulasGroups();
},
show: function () {
show: function (group) {
if (this.$window) {
var main_width, main_height, top, left, win_height = this.initConfig.height;
@ -129,8 +129,8 @@ define([
this.mask.on('mousedown',_.bind(this.onUpdateFocus, this));
this.$window.on('mousedown',_.bind(this.onUpdateFocus, this));
if (this.cmbFuncGroup.getValue() == 0)
this.fillFunctions('Last10');
group && this.cmbFuncGroup.setValue(group);
(group || this.cmbFuncGroup.getValue()=='Last10') && this.fillFunctions(this.cmbFuncGroup.getValue());
if (this.cmbListFunctions) {
_.delay(function (me) {
@ -169,9 +169,7 @@ define([
},
onSelectGroup: function (combo, record) {
if (!_.isUndefined(record) && !_.isUndefined(record.value)) {
if (record.value < this.formulasGroups.length) {
this.fillFunctions(this.formulasGroups.at(record.value).get('name'));
}
record.value && this.fillFunctions(record.value);
}
this.onUpdateFocus();
@ -213,7 +211,7 @@ define([
var group = this.formulasGroups.at(i);
if (group.get('functions').length) {
groupsListItems.push({
value : group.get('index'),
value : group.get('name'),
displayValue : group.get('caption')
});
}
@ -232,7 +230,7 @@ define([
} else {
this.cmbFuncGroup.setData(groupsListItems);
}
this.cmbFuncGroup.setValue(0);
this.cmbFuncGroup.setValue('Last10');
this.fillFunctions('Last10');
}

View file

@ -281,7 +281,7 @@ define([
items: arr
}));
btn.menu.on('item:click', function (menu, item, e) {
me.fireEvent('function:apply', [{name: item.caption, origin: item.value}]);
me.fireEvent('function:apply', [{name: item.caption, origin: item.value}, false, name]);
});
}
}
@ -335,7 +335,7 @@ define([
})
});
mnu.menu.on('item:click', function (menu, item, e) {
me.fireEvent('function:apply', [{name: item.caption, origin: item.value}]);
me.fireEvent('function:apply', [{name: item.caption, origin: item.value}, false, name]);
});
morearr.push(mnu);
}