[SSE] Fix Bug 33907
This commit is contained in:
parent
e258200a94
commit
01473b7240
|
@ -60,6 +60,9 @@ define([
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
Common.NotificationCenter.on('document:ready', _.bind(me.onDocumentReady, me));
|
||||||
|
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'FileMenu': {
|
'FileMenu': {
|
||||||
'settings:apply': function() {
|
'settings:apply': function() {
|
||||||
|
@ -71,32 +74,6 @@ define([
|
||||||
|
|
||||||
setApi: function (api) {
|
setApi: function (api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
|
|
||||||
if (this.formulasGroups && this.api) {
|
|
||||||
this.loadingFormulas();
|
|
||||||
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
this.formulas = new SSE.Views.FormulaDialog({
|
|
||||||
api : this.api,
|
|
||||||
toolclose : 'hide',
|
|
||||||
formulasGroups : this.formulasGroups,
|
|
||||||
handler : function (func) {
|
|
||||||
if (func && me.api) {
|
|
||||||
me.api.asc_insertFormula(func, Asc.c_oAscPopUpSelectorType.Func);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.formulas.on({
|
|
||||||
'hide': function () {
|
|
||||||
if (me.api) {
|
|
||||||
me.api.asc_enableKeyEvents(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -109,6 +86,33 @@ define([
|
||||||
this.formulasGroups = this.getApplication().getCollection('FormulaGroups');
|
this.formulasGroups = this.getApplication().getCollection('FormulaGroups');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onDocumentReady: function () {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
if (me.formulasGroups && me.api) {
|
||||||
|
me.loadingFormulas();
|
||||||
|
|
||||||
|
me.formulas = new SSE.Views.FormulaDialog({
|
||||||
|
api : me.api,
|
||||||
|
toolclose : 'hide',
|
||||||
|
formulasGroups : me.formulasGroups,
|
||||||
|
handler : function (func) {
|
||||||
|
if (func && me.api) {
|
||||||
|
me.api.asc_insertFormula(func, Asc.c_oAscPopUpSelectorType.Func);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
me.formulas.on({
|
||||||
|
'hide': function () {
|
||||||
|
if (me.api) {
|
||||||
|
me.api.asc_enableKeyEvents(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
showDialog: function () {
|
showDialog: function () {
|
||||||
if (this.formulas) {
|
if (this.formulas) {
|
||||||
if (this.needUpdateFormula)
|
if (this.needUpdateFormula)
|
||||||
|
|
|
@ -58,7 +58,8 @@ define([
|
||||||
],
|
],
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
|
Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this));
|
||||||
|
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
|
||||||
|
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'AddFunction': {
|
'AddFunction': {
|
||||||
|
@ -85,6 +86,15 @@ define([
|
||||||
initEvents: function () {
|
initEvents: function () {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onDocumentReady: function () {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
_.defer(function () {
|
||||||
|
me.api.asc_setLocalization(fc);
|
||||||
|
me.fillFunctions.call(me);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
fillFunctions: function() {
|
fillFunctions: function() {
|
||||||
var functions = {};
|
var functions = {};
|
||||||
var jsonDescr = JSON.parse(fd);
|
var jsonDescr = JSON.parse(fd);
|
||||||
|
|
Loading…
Reference in a new issue