From a57a451a3bc77db6e85a80aa38ac08bc3cb8962d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 3 Nov 2020 21:28:25 +0300 Subject: [PATCH] [SSE mobile] Fix Bug 47246 --- apps/common/mobile/lib/controller/Collaboration.js | 6 ------ .../mobile/app/controller/DocumentHolder.js | 11 +---------- .../mobile/app/controller/add/AddOther.js | 5 +++-- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index 555f6af8c1..04af79560f 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -830,9 +830,6 @@ define([ me.indexCurrentComment = 0; me.updateViewComment(); } - if (window.SSE) { - SSE.getController('AddOther').setHideAddComment(true); - } }, apiHideComments: function() { @@ -840,9 +837,6 @@ define([ uiApp.closeModal(); $('.container-view-comment').remove(); } - if (window.SSE) { - SSE.getController('AddOther').setHideAddComment(false); - } }, disabledViewComments: function(disabled) { diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index b112cdb5e5..85d8115499 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -86,16 +86,6 @@ define([ this.api.asc_registerCallback('asc_onHidePopMenu', _.bind(this.onApiHidePopMenu, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect,this)); - this.api.asc_registerCallback('asc_onShowComment', _.bind(this.onApiShowComment, this)); - this.api.asc_registerCallback('asc_onHideComment', _.bind(this.onApiHideComment, this)); - }, - - onApiShowComment: function(comments) { - _isComments = comments && comments.length>0; - }, - - onApiHideComment: function() { - _isComments = false; }, setMode: function (mode) { @@ -313,6 +303,7 @@ define([ var iscelllocked = cellinfo.asc_getLocked(), seltype = cellinfo.asc_getSelectionType(), xfs = cellinfo.asc_getXfs(); + _isComments = cellinfo.asc_getComments().length>0; //prohibit adding multiple comments in one cell; switch (seltype) { case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break; diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js index 983455c934..dd10964052 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddOther.js @@ -70,6 +70,7 @@ define([ var me = this; me.api = api; me.api.asc_registerCallback('asc_onError', _.bind(me.onError, me)); + me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onApiSelectionChanged, me)); // me.api.asc_registerCallback('asc_onInitEditorFonts', _.bind(onApiLoadFonts, me)); @@ -80,8 +81,8 @@ define([ this.view.canViewComments = mode.canViewComments; }, - setHideAddComment: function(hide) { - this.view.isComments = hide; //prohibit adding multiple comments in one cell + onApiSelectionChanged: function(info) { + this.view.isComments = info.asc_getComments().length>0; //prohibit adding multiple comments in one cell }, onLaunch: function () {