[SSE mobile] Fix Bug 47765

This commit is contained in:
Julia Radzhabova 2020-12-01 16:57:58 +03:00
parent 3e4b5cb0d2
commit 1fc68c1327
2 changed files with 12 additions and 7 deletions

View file

@ -851,7 +851,7 @@ define([
} }
} else { } else {
$('.comment-resolve, .comment-menu, .add-reply, .reply-menu').removeClass('disabled'); $('.comment-resolve, .comment-menu, .add-reply, .reply-menu').removeClass('disabled');
if (this.showComments.length > 1) { if (this.showComments && this.showComments.length > 1) {
$('.prev-comment, .next-comment').removeClass('disabled'); $('.prev-comment, .next-comment').removeClass('disabled');
} }
} }
@ -863,7 +863,7 @@ define([
$('.comment-menu').single('click', _.buffered(this.initMenuComments, 100, this)); $('.comment-menu').single('click', _.buffered(this.initMenuComments, 100, this));
$('.reply-menu').single('click', _.buffered(this.initReplyMenu, 100, this)); $('.reply-menu').single('click', _.buffered(this.initReplyMenu, 100, this));
$('.comment-resolve').single('click', _.bind(this.onClickResolveComment, this, false)); $('.comment-resolve').single('click', _.bind(this.onClickResolveComment, this, false));
if (this.showComments.length === 1) { if (this.showComments && this.showComments.length === 1) {
$('.prev-comment, .next-comment').addClass('disabled'); $('.prev-comment, .next-comment').addClass('disabled');
} }
}, },
@ -921,7 +921,7 @@ define([
$('.reply-menu').single('click', _.buffered(me.initReplyMenu, 100, me)); $('.reply-menu').single('click', _.buffered(me.initReplyMenu, 100, me));
$('.comment-resolve').single('click', _.bind(me.onClickResolveComment, me, false)); $('.comment-resolve').single('click', _.bind(me.onClickResolveComment, me, false));
if (me.showComments.length === 1) { if (me.showComments && me.showComments.length === 1) {
$('.prev-comment, .next-comment').addClass('disabled'); $('.prev-comment, .next-comment').addClass('disabled');
} }
@ -998,7 +998,7 @@ define([
}, },
onViewPrevComment: function() { onViewPrevComment: function() {
if (this.showComments.length > 0) { if (this.showComments && this.showComments.length > 0) {
if (this.indexCurrentComment - 1 < 0) { if (this.indexCurrentComment - 1 < 0) {
this.indexCurrentComment = this.showComments.length - 1; this.indexCurrentComment = this.showComments.length - 1;
} else { } else {
@ -1015,7 +1015,7 @@ define([
}, },
onViewNextComment: function() { onViewNextComment: function() {
if (this.showComments.length > 0) { if (this.showComments && this.showComments.length > 0) {
if (this.indexCurrentComment + 1 === this.showComments.length) { if (this.indexCurrentComment + 1 === this.showComments.length) {
this.indexCurrentComment = 0; this.indexCurrentComment = 0;
} else { } else {

View file

@ -237,7 +237,12 @@ define([
break; break;
case 'viewcomment': case 'viewcomment':
me.view.hideMenu(); me.view.hideMenu();
SSE.getController('Common.Controllers.Collaboration').showCommentModal(); var cellinfo = this.api.asc_getCellInfo(),
comments = cellinfo.asc_getComments();
if (comments.length) {
SSE.getController('Common.Controllers.Collaboration').apiShowComments(comments[0].asc_getId());
SSE.getController('Common.Controllers.Collaboration').showCommentModal();
}
break; break;
case 'addcomment': case 'addcomment':
me.view.hideMenu(); me.view.hideMenu();
@ -248,7 +253,7 @@ define([
if ('showActionSheet' == event && _actionSheets.length > 0) { if ('showActionSheet' == event && _actionSheets.length > 0) {
_.delay(function () { _.delay(function () {
_.each(_actionSheets, function (action) { _.each(_actionSheets, function (action) {
action.text = action.caption action.text = action.caption;
action.onClick = function () { action.onClick = function () {
me.onContextMenuClick(null, action.event) me.onContextMenuClick(null, action.event)
} }