Skip to content

Commit

Permalink
Merge pull request '[DE] For bug 69751' (#34) from fix/bug-69751 into…
Browse files Browse the repository at this point in the history
… release/v8.2.0
  • Loading branch information
Julia Radzhabova committed Sep 19, 2024
2 parents b889f15 + a7d3310 commit 087d5af
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1436,9 +1436,9 @@ define([
Common.NotificationCenter.trigger('api:disconnect');

me.appOptions.canStartFilling && Common.Gateway.on('startfilling', _.bind(me.onStartFilling, me));

window.document_content_ready = true;
var timer_sl = setInterval(function(){
if (window.styles_loaded) {
if (window.document_content_ready) {
clearInterval(timer_sl);

toolbarController.createDelayedElements();
Expand Down Expand Up @@ -2707,7 +2707,7 @@ define([

onSendThemeColors: function(colors, standart_colors) {
Common.Utils.ThemeColor.setColors(colors, standart_colors);
if (window.styles_loaded) {
if (window.document_content_ready) {
this.updateThemeColors();
var me = this;
setTimeout(function(){
Expand Down Expand Up @@ -2742,7 +2742,7 @@ define([
});

this.languages = langs;
window.styles_loaded && this.setLanguages();
window.document_content_ready && this.setLanguages();
},

setLanguages: function() {
Expand Down
10 changes: 8 additions & 2 deletions apps/documenteditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,13 @@ define([
var listStyle = this.toolbar.listStyles,
listStylesVisible = (listStyle.rendered);

this._state.prstyle = name;

if (listStylesVisible) {
listStyle.suspendEvents();
var styleRec = listStyle.menuPicker.store.findWhere({
title: name
});
this._state.prstyle = (listStyle.menuPicker.store.length>0 || window.styles_loaded) ? name : undefined;

listStyle.menuPicker.selectRecord(styleRec);
listStyle.resumeEvents();
}
Expand Down Expand Up @@ -2705,7 +2705,11 @@ define([
},

onSaveStyle: function (style) {
if (!window.styles_loaded) return;

window.styles_loaded = false;
this.toolbar.lockToolbar(Common.enumLock.noStyles, !window.styles_loaded, {array: [this.toolbar.listStyles]});

var me = this, win;

if (me.api) {
Expand Down Expand Up @@ -3268,6 +3272,7 @@ define([

_onInitEditorStyles: function(styles) {
window.styles_loaded = false;
this.toolbar.lockToolbar(Common.enumLock.noStyles, !window.styles_loaded, {array: [this.toolbar.listStyles]});

var self = this,
listStyles = self.toolbar.listStyles;
Expand Down Expand Up @@ -3298,6 +3303,7 @@ define([
} else if (listStyles.rendered)
listStyles.clearComboView();
window.styles_loaded = true;
this.toolbar.lockToolbar(Common.enumLock.noStyles, !window.styles_loaded, {array: [this.toolbar.listStyles]});
},

onHomeOpen: function() {
Expand Down
3 changes: 2 additions & 1 deletion apps/documenteditor/main/app/view/DocumentHolderExt.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define([], function () {
dh.createDelayedElements = function() {
var me = this;

if (me.menuInsertCaption || !window.styles_loaded) return; // menu is already inited or editor styles are not loaded
if (me.menuInsertCaption || !window.document_content_ready) return; // menu is already inited or editor styles are not loaded
me.menuInsertCaption = new Common.UI.MenuItem({
caption : me.txtInsertCaption
});
Expand Down Expand Up @@ -1834,6 +1834,7 @@ define([], function () {
menuStyle.setVisible(edit_style);
if (edit_style) {
me.menuStyleUpdate.setCaption(me.updateStyleText.replace('%1', DE.getController('Main').translationTable[window.currentStyleName] || window.currentStyleName));
me.menuStyleSave.setDisabled(!window.styles_loaded);
}

var control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() ||
Expand Down
6 changes: 4 additions & 2 deletions apps/documenteditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ define([
formsNoRoles: 'no-roles',
fixedForm: 'fixed-form',
fileMenuOpened: 'file-menu-opened',
changeModeLock: 'change-mode-lock'
changeModeLock: 'change-mode-lock',
noStyles: 'no-styles'
};
for (var key in enumLock) {
if (enumLock.hasOwnProperty(key)) {
Expand Down Expand Up @@ -1660,7 +1661,7 @@ define([
itemHeight = 40;
this.listStyles = new Common.UI.ComboDataView({
cls: 'combo-styles',
lock: [_set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.inChart, _set.inSmartart, _set.inSmartartInternal, _set.previewReviewMode,
lock: [_set.noStyles, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.plainEditLock, _set.inChart, _set.inSmartart, _set.inSmartartInternal, _set.previewReviewMode,
_set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockView, _set.docLockForms, _set.docLockComments, _set.viewMode],
itemWidth: itemWidth,
itemHeight: itemHeight,
Expand Down Expand Up @@ -1730,6 +1731,7 @@ define([

this.paragraphControls.push(this.listStyles);
this.textOnlyControls.push(this.listStyles);
this.lockToolbar(Common.enumLock.noStyles, !window.styles_loaded, {array: [this.listStyles]})

// Disable all components before load document
this.lockControls = me.toolbarControls.concat(me.paragraphControls);
Expand Down

0 comments on commit 087d5af

Please sign in to comment.