Commit 01473b72 authored by Alexander Yuzhin's avatar Alexander Yuzhin

[SSE] Fix Bug 33907

parent e258200a
...@@ -60,6 +60,9 @@ define([ ...@@ -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,16 +74,28 @@ define([ ...@@ -71,16 +74,28 @@ define([
setApi: function (api) { setApi: function (api) {
this.api = api; this.api = api;
return this;
},
if (this.formulasGroups && this.api) { setMode: function(mode) {
this.loadingFormulas(); this.mode = mode;
return this;
},
onLaunch: function () {
this.formulasGroups = this.getApplication().getCollection('FormulaGroups');
},
var me = this; onDocumentReady: function () {
var me = this;
this.formulas = new SSE.Views.FormulaDialog({ if (me.formulasGroups && me.api) {
api : this.api, me.loadingFormulas();
me.formulas = new SSE.Views.FormulaDialog({
api : me.api,
toolclose : 'hide', toolclose : 'hide',
formulasGroups : this.formulasGroups, formulasGroups : me.formulasGroups,
handler : function (func) { handler : function (func) {
if (func && me.api) { if (func && me.api) {
me.api.asc_insertFormula(func, Asc.c_oAscPopUpSelectorType.Func); me.api.asc_insertFormula(func, Asc.c_oAscPopUpSelectorType.Func);
...@@ -88,7 +103,7 @@ define([ ...@@ -88,7 +103,7 @@ define([
} }
}); });
this.formulas.on({ me.formulas.on({
'hide': function () { 'hide': function () {
if (me.api) { if (me.api) {
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
...@@ -96,17 +111,6 @@ define([ ...@@ -96,17 +111,6 @@ define([
} }
}); });
} }
return this;
},
setMode: function(mode) {
this.mode = mode;
return this;
},
onLaunch: function () {
this.formulasGroups = this.getApplication().getCollection('FormulaGroups');
}, },
showDialog: function () { showDialog: function () {
......
...@@ -58,7 +58,8 @@ define([ ...@@ -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([ ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment