From 485c31bc80da49614f9aeee82b4c52fad4c4f60a Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 27 May 2020 17:03:14 +0300 Subject: [PATCH] [DE mobile] Fix bug 45472 --- .../mobile/app/controller/add/AddOther.js | 16 +++++++++++---- .../mobile/app/template/AddOther.template | 4 ++-- .../mobile/app/view/add/AddOther.js | 20 ++++++++++++++----- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/add/AddOther.js b/apps/documenteditor/mobile/app/controller/add/AddOther.js index 2ad031f272..1eaa9c01dc 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddOther.js +++ b/apps/documenteditor/mobile/app/controller/add/AddOther.js @@ -91,10 +91,13 @@ define([ }, initEvents: function () { - this.view.hideInsertComments = this.isHideInsertComment(); + this.setDisableMenuItem(); }, - isHideInsertComment: function() { + setDisableMenuItem: function() { + var isDisableComment = true, + isDisableBreak = false, + isDisableFootnote = false; var stack = this.api.getSelectedElements(); var isText = false, isTable = false, @@ -133,9 +136,14 @@ define([ }); if (stack.length > 0) { var isObject = isShape || isChart || isImage || isTable; - return (this.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject)); + isDisableComment = (this.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject)); + if (isShape && isText) { + isDisableBreak = isDisableFootnote = true; + } } - return true; + this.view.isDisableComment = isDisableComment; + this.view.isDisableBreak = isDisableBreak; + this.view.isDisableFootnote = isDisableFootnote; }, onPageShow: function (view, pageId) { diff --git a/apps/documenteditor/mobile/app/template/AddOther.template b/apps/documenteditor/mobile/app/template/AddOther.template index b67fdcf51e..773bdfd58c 100644 --- a/apps/documenteditor/mobile/app/template/AddOther.template +++ b/apps/documenteditor/mobile/app/template/AddOther.template @@ -38,7 +38,7 @@ -
  • +
  • -
  • +
  • diff --git a/apps/documenteditor/mobile/app/view/add/AddOther.js b/apps/documenteditor/mobile/app/view/add/AddOther.js index 61947bff8d..28547d3c99 100644 --- a/apps/documenteditor/mobile/app/view/add/AddOther.js +++ b/apps/documenteditor/mobile/app/view/add/AddOther.js @@ -68,14 +68,24 @@ define([ $('#add-other-link').single('click', _.bind(me.showLink, me)); $('#add-other-pagenumber').single('click', _.bind(me.showPagePosition, me)); - $('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me)); - $('#add-other-break').single('click', _.bind(me.showPageBreak, me)); - if (this.hideInsertComments) { - $('#item-comment').hide(); + if (this.isDisableComment) { + $('#item-comment').addClass('disabled'); } else { - $('#item-comment').show(); + $('#item-comment').removeClass('disabled'); $('#add-other-comment').single('click', _.bind(me.showPageComment, me)); } + if (this.isDisableBreak) { + $('#item-break').addClass('disabled'); + } else { + $('#item-break').removeClass('disabled'); + $('#add-other-break').single('click', _.bind(me.showPageBreak, me)); + } + if (this.isDisableFootnote) { + $('#item-footnote').addClass('disabled'); + } else { + $('#item-footnote').removeClass('disabled'); + $('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me)); + } me.initControls(); },