Skip to content

Commit

Permalink
[PE] Fix loading languages
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Sep 16, 2024
1 parent 037ddbe commit eedcda8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/documenteditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ define([
}

me.showMathTrackOnLoad && me.onShowMathTrack(me.lastMathTrackBounds);
me.documentHolder && me.documentHolder.setLanguages();
},

createDelayedElements: function(view, type) {
Expand Down
10 changes: 8 additions & 2 deletions apps/documenteditor/main/app/view/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ define([
isFormsOnly: false,
isCommentsOnly: false
};
this._langs = null;
},

render: function () {
Expand Down Expand Up @@ -189,8 +190,13 @@ define([

setLanguages: function(langs){
var me = this;

if (langs && langs.length > 0 && me.langParaMenu && me.langTableMenu) {
if (!langs) langs = me._langs;
if (langs && langs.length > 0) {
if (!me.langParaMenu || !me.langTableMenu) {
me._langs = langs;
return;
}
me._langs = null;
var arrPara = [], arrTable = [];
_.each(langs, function(lang) {
var item = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ define([
}

me.showMathTrackOnLoad && me.onShowMathTrack(me.lastMathTrackBounds);
me.documentHolder && me.documentHolder.setLanguages();
},

getView: function (name) {
Expand Down
9 changes: 8 additions & 1 deletion apps/presentationeditor/main/app/view/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ define([
me._isDisabled = false;
me._preventCustomClick = null;
me._hasCustomItems = false;
me._langs = null;

Common.NotificationCenter.on('settings:unitschanged', _.bind(this.unitsChanged, this));
},
Expand Down Expand Up @@ -218,7 +219,13 @@ define([

setLanguages: function(langs){
var me = this;
if (langs && langs.length > 0 && me.langParaMenu && me.langTableMenu) {
if (!langs) langs = me._langs;
if (langs && langs.length > 0) {
if (!me.langParaMenu || !me.langTableMenu) {
me._langs = langs;
return;
}
me._langs = null;
var arrPara = [], arrTable = [];
_.each(langs, function(lang) {
var item = {
Expand Down

0 comments on commit eedcda8

Please sign in to comment.