Merge pull request 'fix/crit-bug-fix' (#1033) from fix/crit-bug-fix into release/v9.4.0

Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/web-apps/pulls/1033
This commit is contained in:
Oleg Korshul
2026-03-01 11:30:44 +00:00
4 changed files with 10 additions and 5 deletions

View File

@ -161,7 +161,7 @@ define([
getView: function(name) {
return !name && this.view ?
this.view : Backbone.Controller.prototype.getView.call(this, name);
this.view : name ? Backbone.Controller.prototype.getView.call(this, name) : undefined;
},
onCoAuthoringDisconnect: function() {

View File

@ -4029,11 +4029,11 @@ define([
config.isEdit && config.canFeatureContentControl && me.onChangeSdtGlobalSettings();
tab = {caption: me.toolbar.textTabView, action: 'view', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-view', dataHintTitle: 'W'};
var viewtab = application.getController('ViewTab');
const viewtab = application.getController('ViewTab');
viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
$panel = viewtab.createToolbarPanel();
if ($panel) {
var visible = Common.UI.LayoutManager.isElementVisible('toolbar-view');
const visible = Common.UI.LayoutManager.isElementVisible('toolbar-view');
me.toolbar.addTab(tab, $panel, 8);
me.toolbar.setVisible('view', visible);
!editmode && !compactview && visible && Common.Utils.InternalSettings.set('toolbar-active-tab', 'view'); // need to activate later

View File

@ -286,7 +286,8 @@ define([
},
onDocumentReady: function() {
Common.Utils.lockControls(Common.enumLock.disableOnStart, false, {array: this.view.lockedControls});
if ( this.view )
Common.Utils.lockControls(Common.enumLock.disableOnStart, false, {array: this.view.lockedControls});
},
onMultiplePages: function (pressed) {

View File

@ -954,7 +954,9 @@ define([], function () {
content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked,
is_form = control_props && control_props.get_FormPr();
me.menuImgStretchContentControl.setVisible(is_form);
me.menuImgStretchContentControl.setVisible(is_form && (!lock_type || lock_type == Asc.c_oAscSdtLockType.Unlocked));
is_form && console.log('menuImgStretch visible');
me.menuImgRemoveControl.setVisible(in_control);
me.menuImgControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form);
menuImgControlSeparator.setVisible(in_control);
@ -1820,6 +1822,8 @@ define([], function () {
is_form = control_props && control_props.get_FormPr();
me.menuTableRemoveForm.setVisible(is_form);
me.menuTableStretchContentControl.setVisible(is_form);
is_form && console.log('menuTableStretch visible');
menuTableControl.setVisible(!is_form);
if (is_form) {
me.menuTableRemoveForm.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);