Merge pull request #684 from ONLYOFFICE/fix/hide-forms

[DE] Hide forms
This commit is contained in:
Julia Radzhabova 2021-01-29 20:05:58 +03:00 committed by GitHub
commit f32e6cd74c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View file

@ -159,7 +159,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

@ -371,6 +371,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.2
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');

View file

@ -3095,12 +3095,14 @@ define([
Array.prototype.push.apply(me.toolbar.toolbarControls, links.getView('Links').getButtons());
if (config.canFeatureContentControl) {
if (config.canFeatureForms) {
tab = {caption: me.textTabForms, action: 'forms'};
var forms = me.getApplication().getController('FormsTab');
forms.setApi(me.api).setConfig({toolbar: me});
me.toolbar.addTab(tab, $panel, 4);
me.toolbar.setVisible('forms', true);
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
}
me.onChangeSdtGlobalSettings();
}
}

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,