From 64355cc7db1b60186f5be07ac50acdb9e6f0df46 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 29 Jun 2017 15:06:31 +0300 Subject: [PATCH] [DE] Disable comments on toolbar when objects are locked. [PE] Disable comments on toolbar when no slides. --- apps/documenteditor/main/app/controller/Toolbar.js | 3 +-- apps/presentationeditor/main/app/controller/Toolbar.js | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 023b12c95..54b2cae73 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -728,7 +728,7 @@ define([ if (toolbar.listStylesAdditionalMenuItem && (frame_pr===undefined) !== toolbar.listStylesAdditionalMenuItem.isDisabled()) toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined); - need_disable = paragraph_locked || header_locked || in_chart || this.api.can_AddQuotedComment()===false; + need_disable = (paragraph_locked || header_locked) && this.api.can_AddQuotedComment() || image_locked; if (this.btnsComment && this.btnsComment.length>0 && need_disable != this.btnsComment[0].isDisabled()) _.each (this.btnsComment, function(item){ item.setDisabled(need_disable); @@ -2810,7 +2810,6 @@ define([ if ( this.btnsComment.length ) { var _comments = DE.getController('Common.Controllers.Comments').getView(); - Array.prototype.push.apply(me.toolbar.paragraphControls, this.btnsComment); this.btnsComment.forEach(function (btn) { btn.updateHint( _comments.textAddComment ); btn.on('click', function (btn, e) { diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 8131cce77..7638ad82d 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -650,11 +650,9 @@ define([ if (shape_locked!==undefined && this._state.shapecontrolsdisable !== shape_locked) { if (this._state.activated) this._state.shapecontrolsdisable = shape_locked; - this.toolbar.lockToolbar(PE.enumLock.shapeLock, shape_locked, {array: me.toolbar.shapeControls.concat(me.toolbar.paragraphControls).concat(me.btnsComment)}); + this.toolbar.lockToolbar(PE.enumLock.shapeLock, shape_locked, {array: me.toolbar.shapeControls.concat(me.toolbar.paragraphControls)}); } - this.toolbar.lockToolbar(PE.enumLock.commentLock, this.api.can_AddQuotedComment() === false, { array: this.btnsComment }); - if (this._state.no_object !== no_object ) { if (this._state.activated) this._state.no_object = no_object; this.toolbar.lockToolbar(PE.enumLock.noObjectSelected, no_object, {array: [me.toolbar.btnShapeAlign, me.toolbar.btnShapeArrange ]}); @@ -2074,7 +2072,7 @@ define([ var button = new Common.UI.Button({ cls: _cls, iconCls: 'btn-menu-comments', - lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.shapeLock, _set.commentLock], + lock: [_set.lostConnect, _set.noSlides], caption: me.toolbar.capBtnComment }).render( slots.eq(index) ); @@ -2084,7 +2082,6 @@ define([ if ( this.btnsComment.length ) { var _comments = PE.getController('Common.Controllers.Comments').getView(); Array.prototype.push.apply(me.toolbar.lockControls, this.btnsComment); - Array.prototype.push.apply(me.toolbar.slideOnlyControls, this.btnsComment); this.btnsComment.forEach(function (btn) { btn.updateHint( _comments.textAddComment ); btn.on('click', function (btn, e) {