From a1669cc103047d72bbd4250f74feed488424327d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 28 Oct 2021 13:15:00 +0300 Subject: [PATCH] Review: add toolips for accept/reject buttons in balloons. Comments: add toolips for edit/delete buttons in balloons (Bug 39539) --- apps/common/main/lib/view/ReviewPopover.js | 46 +++++++++++++++++++-- apps/documenteditor/main/locale/en.json | 4 ++ apps/presentationeditor/main/locale/en.json | 2 + apps/spreadsheeteditor/main/locale/en.json | 2 + 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/view/ReviewPopover.js b/apps/common/main/lib/view/ReviewPopover.js index 3ec41bc6a..7b6052726 100644 --- a/apps/common/main/lib/view/ReviewPopover.js +++ b/apps/common/main/lib/view/ReviewPopover.js @@ -237,7 +237,6 @@ define([ } else { this.commentsView = new CommentsPopoverDataView({ el: $('#id-comments-popover'), - store: me.commentsStore, itemTemplate: _.template(replaceWords(commentsTemplate, { textAddReply: me.textAddReply, textAdd: me.textAdd, @@ -269,6 +268,16 @@ define([ btns.each(function (idx, item) { arr.push($(item).data('bs.tooltip').tip()); }); + btns = $(view.el).find('.btn-edit'); + btns.tooltip({title: me.txtEditTip, placement: 'cursor'}); + btns.each(function (idx, item) { + arr.push($(item).data('bs.tooltip').tip()); + }); + btns = $(view.el).find('.btn-delete'); + btns.tooltip({title: me.txtDeleteTip, placement: 'cursor'}); + btns.each(function (idx, item) { + arr.push($(item).data('bs.tooltip').tip()); + }); view.tipsArray = arr; this.autoHeightTextBox(); }; @@ -286,6 +295,9 @@ define([ this.commentsView.on('item:change', addtooltip); this.commentsView.cmpEl.on('mouseover', onCommentsViewMouseOver).on('mouseout', onCommentsViewMouseOut); + this.commentsView.setStore(me.commentsStore); + this.commentsView.onResetItems(); + this.commentsView.on('item:click', function (picker, item, record, e) { var btn, showEditBox, showReplyBox, commentId, replyId, hideAddReply; @@ -307,6 +319,9 @@ define([ } if (btn.hasClass('btn-edit')) { + var tip = btn.data('bs.tooltip'); + if (tip) tip.dontShow = true; + if (!_.isUndefined(replyId)) { me.fireEvent('comment:closeEditing', [commentId]); me.fireEvent('comment:editReply', [commentId, replyId, true]); @@ -347,6 +362,9 @@ define([ } } } else if (btn.hasClass('btn-delete')) { + var tip = btn.data('bs.tooltip'); + if (tip) tip.dontShow = true; + if (!_.isUndefined(replyId)) { me.fireEvent('comment:removeReply', [commentId, replyId]); @@ -518,7 +536,6 @@ define([ } else { this.reviewChangesView = new ReviewPopoverDataView({ el: $('#id-review-popover'), - store: me.reviewStore, itemTemplate: _.template(reviewTemplate) }); @@ -535,6 +552,16 @@ define([ btns.each(function (idx, item) { arr.push($(item).data('bs.tooltip').tip()); }); + btns = $(view.el).find('.btn-accept'); + btns.tooltip({title: me.txtAccept, placement: 'cursor'}); + btns.each(function (idx, item) { + arr.push($(item).data('bs.tooltip').tip()); + }); + btns = $(view.el).find('.btn-reject'); + btns.tooltip({title: me.txtReject, placement: 'cursor'}); + btns.each(function (idx, item) { + arr.push($(item).data('bs.tooltip').tip()); + }); view.tipsArray = arr; }; @@ -546,8 +573,14 @@ define([ var btn = $(e.target); if (btn) { if (btn.hasClass('btn-accept')) { + var tip = btn.data('bs.tooltip'); + if (tip) tip.dontShow = true; + me.fireEvent('reviewchange:accept', [record.get('changedata')]); } else if (btn.hasClass('btn-reject')) { + var tip = btn.data('bs.tooltip'); + if (tip) tip.dontShow = true; + me.fireEvent('reviewchange:reject', [record.get('changedata')]); } else if (btn.hasClass('btn-delete')) { me.fireEvent('reviewchange:delete', [record.get('changedata')]); @@ -559,6 +592,9 @@ define([ } } }); + + this.reviewChangesView.setStore(me.reviewStore); + this.reviewChangesView.onResetItems(); } } @@ -1249,6 +1285,10 @@ define([ textOpenAgain : "Open Again", textFollowMove : 'Follow Move', textMention : '+mention will provide access to the document and send an email', - textMentionNotify : '+mention will notify the user via email' + textMentionNotify : '+mention will notify the user via email', + txtAccept: 'Accept', + txtReject: 'Reject', + txtEditTip: 'Edit', + txtDeleteTip: 'Delete' }, Common.Views.ReviewPopover || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 7e9248164..10eb5200b 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -431,6 +431,10 @@ "Common.Views.ReviewPopover.textOpenAgain": "Open Again", "Common.Views.ReviewPopover.textReply": "Reply", "Common.Views.ReviewPopover.textResolve": "Resolve", + "Common.Views.ReviewPopover.txtAccept": "Accept current change", + "Common.Views.ReviewPopover.txtReject": "Reject current change", + "Common.Views.ReviewPopover.txtEditTip": "Edit", + "Common.Views.ReviewPopover.txtDeleteTip": "Delete", "Common.Views.SaveAsDlg.textLoading": "Loading", "Common.Views.SaveAsDlg.textTitle": "Folder for save", "Common.Views.SelectFileDlg.textLoading": "Loading", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index ac65186e1..9abb97b9c 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -312,6 +312,8 @@ "Common.Views.ReviewPopover.textOpenAgain": "Open Again", "Common.Views.ReviewPopover.textReply": "Reply", "Common.Views.ReviewPopover.textResolve": "Resolve", + "Common.Views.ReviewPopover.txtEditTip": "Edit", + "Common.Views.ReviewPopover.txtDeleteTip": "Delete", "Common.Views.SaveAsDlg.textLoading": "Loading", "Common.Views.SaveAsDlg.textTitle": "Folder for save", "Common.Views.SelectFileDlg.textLoading": "Loading", diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 6e0a6ac81..1ca27aeb2 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -364,6 +364,8 @@ "Common.Views.ReviewPopover.textOpenAgain": "Open Again", "Common.Views.ReviewPopover.textReply": "Reply", "Common.Views.ReviewPopover.textResolve": "Resolve", + "Common.Views.ReviewPopover.txtEditTip": "Edit", + "Common.Views.ReviewPopover.txtDeleteTip": "Delete", "Common.Views.SaveAsDlg.textLoading": "Loading", "Common.Views.SaveAsDlg.textTitle": "Folder for save", "Common.Views.SelectFileDlg.textLoading": "Loading",