From b7089a734486c33731682db1e4ba6165d45e9736 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 9 Feb 2021 17:21:02 +0300 Subject: [PATCH] [DE] Show Forms tab in fill form mode --- apps/documenteditor/main/app/controller/Toolbar.js | 6 ++++-- apps/documenteditor/main/app/controller/Viewport.js | 8 ++++---- apps/documenteditor/main/app/view/Toolbar.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 556f46a17..996f94b33 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -3053,8 +3053,8 @@ define([ onAppShowed: function (config) { var me = this; - var compactview = !config.isEdit; - if ( config.isEdit ) { + var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms); + if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) { if ( Common.localStorage.itemExists("de-compact-toolbar") ) { compactview = Common.localStorage.getBool("de-compact-toolbar"); } else @@ -3112,6 +3112,8 @@ define([ 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'); } } } diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 5780631da..5f44a908a 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -165,7 +165,7 @@ define([ me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); - if ( !config.isEdit || + if ( !(config.isEdit || config.isRestrictedEdit && config.canFillForms) || ( !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; - if ( config.isEdit ) { + var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms); + if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) { if ( Common.localStorage.itemExists("de-compact-toolbar") ) { compactview = Common.localStorage.getBool("de-compact-toolbar"); } else @@ -223,7 +223,7 @@ define([ if (!config.isEdit) { me.header.mnuitemCompactToolbar.hide(); Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){ - if ((action=='plugins' || action=='review') && visible) { + if ((action=='plugins' || action=='review' || action=='forms') && visible) { me.header.mnuitemCompactToolbar.show(); } }, this)); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 01e9a82d1..a9fed7bb6 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1281,7 +1281,7 @@ define([ me.$el.html(me.rendererComponents(me.$layout)); } else { me.$layout.find('.canedit').hide(); - me.$layout.addClass('folded'); + me.isCompactView && me.$layout.addClass('folded'); me.$el.html(me.$layout); }