Merge pull request #853 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2021-04-30 12:41:03 +03:00 committed by GitHub
commit d4e1bceec3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 19 deletions

View file

@ -170,7 +170,7 @@ define([
},
onControlsSelect: function(type) {
if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl)) return;
if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl && this.toolbar.mode.canFeatureForms)) return;
var oPr,
oFormPr = new AscCommon.CSdtFormPr();

View file

@ -390,6 +390,7 @@ define([
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls");
this.appOptions.canFeatureForms = false; // hide in 6.3
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));

View file

@ -3092,8 +3092,8 @@ define([
onAppShowed: function (config) {
var me = this;
var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms);
if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) {
var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms);
if ( config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) {
if ( Common.localStorage.itemExists("de-compact-toolbar") ) {
compactview = Common.localStorage.getBool("de-compact-toolbar");
} else
@ -3141,21 +3141,23 @@ define([
Array.prototype.push.apply(me.toolbar.toolbarControls, links.getView('Links').getButtons());
}
if ( config.isEdit && config.canFeatureContentControl || config.isRestrictedEdit && config.canFillForms ) {
tab = {caption: me.textTabForms, action: 'forms'};
var forms = me.getApplication().getController('FormsTab');
forms.setApi(me.api).setConfig({toolbar: me, config: config});
$panel = forms.createToolbarPanel();
if ($panel) {
me.toolbar.addTab(tab, $panel, 4);
me.toolbar.setVisible('forms', true);
if (config.isEdit && config.canFeatureContentControl) {
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
me.onChangeSdtGlobalSettings();
} else if (!compactview) {
me.toolbar.setTab('forms');
if (config.canFeatureForms) {
tab = {caption: me.textTabForms, action: 'forms'};
var forms = me.getApplication().getController('FormsTab');
forms.setApi(me.api).setConfig({toolbar: me, config: config});
$panel = forms.createToolbarPanel();
if ($panel) {
me.toolbar.addTab(tab, $panel, 4);
me.toolbar.setVisible('forms', true);
if (config.isEdit && config.canFeatureContentControl) {
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
} else if (!compactview) {
me.toolbar.setTab('forms');
}
}
}
}
config.isEdit && config.canFeatureContentControl && me.onChangeSdtGlobalSettings();
},
onAppReady: function (config) {

View file

@ -165,7 +165,7 @@ define([
me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]);
if ( !(config.isEdit || config.isRestrictedEdit && config.canFillForms) ||
if ( !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) ||
( !Common.localStorage.itemExists("de-compact-toolbar") &&
config.customization && config.customization.compactToolbar )) {
@ -205,8 +205,8 @@ define([
onAppReady: function (config) {
var me = this;
if ( me.header.btnOptions ) {
var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms);
if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) {
var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms);
if ( config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) {
if ( Common.localStorage.itemExists("de-compact-toolbar") ) {
compactview = Common.localStorage.getBool("de-compact-toolbar");
} else

View file

@ -323,6 +323,7 @@ define([
if (this.api) {
// this.api.asc_registerCallback('asc_onParaSpacingLine', _.bind(this._onLineSpacing, this));
}
Common.NotificationCenter.on('storage:image-insert', _.bind(this.insertImageFromStorage, this));
return this;
},

View file

@ -211,7 +211,7 @@ define([
this.signatureSettings = new DE.Views.SignatureSettings();
}
if (mode && mode.canFeatureContentControl && mode.canEditContentControl) {
if (mode && mode.canFeatureContentControl && mode.canEditContentControl && mode.canFeatureForms) {
this.btnForm = new Common.UI.Button({
hint: this.txtFormSettings,
asctype: Common.Utils.documentSettingsType.Form,