diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 3018058b3..13ef732cf 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -739,7 +739,7 @@ define([ leftMenu.setPreviewMode(disable); if (this.view) { - this.view.$el.find('.no-group-mask').css('opacity', 1); + this.view.$el.find('.no-group-mask.review').css('opacity', 1); this.view.btnsDocLang && this.view.btnsDocLang.forEach(function(button) { if ( button ) { diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index 570356601..2116415f8 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -57,7 +57,7 @@ define([ Common.Views.ReviewChanges = Common.UI.BaseView.extend(_.extend((function(){ var template = '
' + - '
' + + '
' + '' + '' + '
' + @@ -70,7 +70,7 @@ define([ '
' + '' + '
' + - '
' + + '
' + '' + '
' + '
' + @@ -84,11 +84,11 @@ define([ '' + '
' + '
' + - '
' + + '
' + '' + '
' + '
' + - '
' + + '
' + '' + '
' + '
'; diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 9de955849..8d41dbd5f 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -220,7 +220,8 @@ define([ onModeClick: function(state) { if (this.api) { - + this.disableEditing(state); + this.api.asc_setRestriction(state ? Asc.c_oAscRestrictionType.OnlyForms : Asc.c_oAscRestrictionType.None); } Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, @@ -250,6 +251,28 @@ define([ this.api.asc_SetGlobalContentControlShowHighlight(true, clr.get_r(), clr.get_g(), clr.get_b()); } Common.NotificationCenter.trigger('edit:complete', this.toolbar); + }, + + disableEditing: function(disable) { + if (this._state.DisabledEditing != disable) { + this._state.DisabledEditing = disable; + + var app = this.getApplication(); + var rightMenuController = app.getController('RightMenu'); + rightMenuController.getView('RightMenu').clearSelection(); + rightMenuController.SetDisabled(disable); + app.getController('Toolbar').DisableToolbar(disable, false, false, true); + app.getController('Statusbar').getView('Statusbar').SetDisabled(disable); + app.getController('Common.Controllers.ReviewChanges').SetDisabled(disable); + app.getController('DocumentHolder').getView().SetDisabled(disable); + app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable); + app.getController('LeftMenu').setPreviewMode(disable); + var comments = app.getController('Common.Controllers.Comments'); + if (comments) + comments.setPreviewMode(disable); + if (this.view) + this.view.$el.find('.no-group-mask.form-view').css('opacity', 1); + } } }, DE.Controllers.FormsTab || {})); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index dba578ebd..8fe5ab22f 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2896,27 +2896,36 @@ define([ this.DisableToolbar(true, true); }, - DisableToolbar: function(disable, viewMode, reviewmode) { + DisableToolbar: function(disable, viewMode, reviewmode, fillformmode) { if (viewMode!==undefined) this.editMode = !viewMode; disable = disable || !this.editMode; var toolbar_mask = $('.toolbar-mask'), group_mask = $('.toolbar-group-mask'), - mask = reviewmode ? group_mask : toolbar_mask; + mask = (reviewmode || fillformmode) ? group_mask : toolbar_mask; if (disable && mask.length>0 || !disable && mask.length==0) return; var toolbar = this.toolbar; if(disable) { if (reviewmode) { - mask = $("
").appendTo(toolbar.$el.find('.toolbar section.panel .group:not(.no-mask):not(.no-group-mask)')); + mask = $("
").appendTo(toolbar.$el.find('.toolbar section.panel .group:not(.no-mask):not(.no-group-mask.review)')); + } else if (fillformmode) { + mask = $("
").appendTo(toolbar.$el.find('.toolbar section.panel .group:not(.no-mask):not(.no-group-mask.form-view)')); } else mask = $("
").appendTo(toolbar.$el.find('.toolbar')); } else { mask.remove(); } - $('.no-group-mask').css('opacity', (reviewmode || !disable) ? 1 : 0.4); + $('.no-group-mask').each(function(index, item){ + var $el = $(item); + if ($el.find('.toolbar-group-mask').length>0) + $el.css('opacity', 0.4); + else { + $el.css('opacity', reviewmode || fillformmode || !disable ? 1 : 0.4); + } + }); - disable = disable || (reviewmode ? toolbar_mask.length>0 : group_mask.length>0); + disable = disable || ((reviewmode || fillformmode) ? toolbar_mask.length>0 : group_mask.length>0); toolbar.$el.find('.toolbar').toggleClass('masked', disable); if ( toolbar.synchTooltip ) toolbar.synchTooltip.hide(); diff --git a/apps/documenteditor/main/app/template/Toolbar.template b/apps/documenteditor/main/app/template/Toolbar.template index ffc080110..1fff3ec2c 100644 --- a/apps/documenteditor/main/app/template/Toolbar.template +++ b/apps/documenteditor/main/app/template/Toolbar.template @@ -180,7 +180,7 @@
-
+