From 7dfb96f914877b00daba92073cf26c5d2bfdd71d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 4 Aug 2021 13:19:19 +0300 Subject: [PATCH 1/6] [DE] Add simple markup mode for display review changes --- apps/api/documents/api.js | 2 +- .../main/lib/controller/ReviewChanges.js | 25 +++++++++----- apps/common/main/lib/view/ReviewChanges.js | 18 ++++++++-- .../lib/controller/collaboration/Review.jsx | 34 +++++++++---------- apps/documenteditor/main/locale/en.json | 2 ++ 5 files changed, 51 insertions(+), 30 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 2aa7ad002..55d5e7bc1 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -155,7 +155,7 @@ compactHeader: false, toolbarNoTabs: false, toolbarHideFileName: false, - reviewDisplay: 'original', + reviewDisplay: 'original', // original for viewer, markup for editor spellcheck: true, compatibleFeatures: false, unit: 'cm' // cm, pt, inch, diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index b9c7ac6b2..549ed477f 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -595,7 +595,10 @@ define([ onReviewViewClick: function(menu, item, e) { this.turnDisplayMode(item.value); - !this.appConfig.canReview && Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value); + if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit) + Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value); // for viewer + else if (item.value=='markup' || item.value=='simple') + Common.localStorage.setItem(this.view.appPrefix + "review-mode-editor", item.value); // for editor save only markup modes Common.NotificationCenter.trigger('edit:complete', this.view); }, @@ -690,7 +693,7 @@ define([ else if (mode === 'original') this.api.asc_BeginViewModeInReview(false); else - this.api.asc_EndViewModeInReview(); + this.api.asc_EndViewModeInReview(mode=='simple'); } this.disableEditing(mode == 'final' || mode == 'original'); this._state.previewMode = (mode == 'final' || mode == 'original'); @@ -702,9 +705,9 @@ define([ this._state.previewMode = true; }, - onEndViewModeInReview: function() { + onEndViewModeInReview: function(mode) { this.disableEditing(false); - this.view && this.view.turnDisplayMode('markup'); + this.view && this.view.turnDisplayMode(mode ? 'simple' : 'markup'); this._state.previewMode = false; }, @@ -804,7 +807,11 @@ define([ me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions()); me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true); - // _setReviewStatus(state, global); + var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode-editor"); + if (val===null) + val = me.appConfig.customization && /^(original|final|markup|simple)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'markup'; + me.turnDisplayMode(val); // load display mode for all modes (viewer or editor) + me.view.turnDisplayMode(val); if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) { me.dlgChanges = (new Common.Views.ReviewChangesDialog({ @@ -819,11 +826,11 @@ define([ } else if (config.canViewReview) { config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users if (config.canViewReview) { - var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode"); + var val = Common.localStorage.getItem(me.view.appPrefix + (config.isEdit || config.isRestrictedEdit ? "review-mode-editor" : "review-mode")); if (val===null) - val = me.appConfig.customization && /^(original|final|markup)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'original'; - me.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer - me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); + val = me.appConfig.customization && /^(original|final|markup|simple)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : (config.isEdit || config.isRestrictedEdit ? 'markup' : 'original'); + me.turnDisplayMode(val); + me.view.turnDisplayMode(val); } } diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index 0b52de0d9..d30a0448b 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -298,6 +298,15 @@ define([ template: menuTemplate, description: this.txtMarkup }, + { + caption: this.txtMarkupSimpleCap, + checkable: true, + toggleGroup: 'menuReviewView', + checked: false, + value: 'simple', + template: menuTemplate, + description: this.txtMarkupSimple + }, { caption: this.txtFinalCap, checkable: true, @@ -750,8 +759,9 @@ define([ turnDisplayMode: function(mode) { if (this.btnReviewView) { this.btnReviewView.menu.items[0].setChecked(mode=='markup', true); - this.btnReviewView.menu.items[1].setChecked(mode=='final', true); - this.btnReviewView.menu.items[2].setChecked(mode=='original', true); + this.btnReviewView.menu.items[1].setChecked(mode=='simple', true); + this.btnReviewView.menu.items[2].setChecked(mode=='final', true); + this.btnReviewView.menu.items[3].setChecked(mode=='original', true); } }, @@ -850,7 +860,9 @@ define([ txtOff: 'OFF for me', textWarnTrackChangesTitle: 'Enable Track Changes for everyone?', textWarnTrackChanges: 'Track Changes will be switched ON for all users with full access. The next time anyone opens the doc, Track Changes will remain enabled.', - textEnable: 'Enable' + textEnable: 'Enable', + txtMarkupSimpleCap: 'Simple Markup', + txtMarkupSimple: 'All changes (Editing)
Turn off pop-up windows with changes' } }()), Common.Views.ReviewChanges || {})); diff --git a/apps/common/mobile/lib/controller/collaboration/Review.jsx b/apps/common/mobile/lib/controller/collaboration/Review.jsx index 1ffa6780d..507c0d850 100644 --- a/apps/common/mobile/lib/controller/collaboration/Review.jsx +++ b/apps/common/mobile/lib/controller/collaboration/Review.jsx @@ -22,24 +22,24 @@ class InitReview extends Component { api.asc_SetTrackRevisions(appOptions.isReviewOnly || trackChanges===true || (trackChanges!==false) && LocalStorage.getBool("de-mobile-track-changes-" + (appOptions.fileKey || ''))); // Init display mode - if (!appOptions.canReview) { - const canViewReview = appOptions.isEdit || api.asc_HaveRevisionsChanges(true); + + const canViewReview = appOptions.canReview || appOptions.isEdit || api.asc_HaveRevisionsChanges(true); + if (!appOptions.canReview) appOptions.setCanViewReview(canViewReview); - if (canViewReview) { - let viewReviewMode = LocalStorage.getItem("de-view-review-mode"); - if (viewReviewMode === null) - viewReviewMode = appOptions.customization && /^(original|final|markup)$/i.test(appOptions.customization.reviewDisplay) ? appOptions.customization.reviewDisplay.toLocaleLowerCase() : 'original'; - viewReviewMode = (appOptions.isEdit || appOptions.isRestrictedEdit) ? 'markup' : viewReviewMode; - const displayMode = viewReviewMode.toLocaleLowerCase(); - if (displayMode === 'final') { - api.asc_BeginViewModeInReview(true); - } else if (displayMode === 'original') { - api.asc_BeginViewModeInReview(false); - } else { - api.asc_EndViewModeInReview(); - } - props.storeReview.changeDisplayMode(displayMode); + if (canViewReview) { + let viewReviewMode = (appOptions.isEdit || appOptions.isRestrictedEdit) ? null : LocalStorage.getItem("de-view-review-mode"); + if (viewReviewMode === null) + viewReviewMode = appOptions.customization && /^(original|final|markup|simple)$/i.test(appOptions.customization.reviewDisplay) ? appOptions.customization.reviewDisplay.toLocaleLowerCase() : ( appOptions.isEdit || appOptions.isRestrictedEdit ? 'markup' : 'original'); + let displayMode = viewReviewMode.toLocaleLowerCase(); + if (displayMode === 'final') { + api.asc_BeginViewModeInReview(true); + } else if (displayMode === 'original') { + api.asc_BeginViewModeInReview(false); + } else { + (displayMode === 'simple') && (displayMode = 'markup'); + api.asc_EndViewModeInReview(); } + props.storeReview.changeDisplayMode(displayMode); } }); } @@ -102,7 +102,7 @@ class Review extends Component { } else { api.asc_EndViewModeInReview(); } - !this.appConfig.canReview && LocalStorage.setItem("de-view-review-mode", mode); + !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit && LocalStorage.setItem("de-view-review-mode", mode); this.props.storeReview.changeDisplayMode(mode); } diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 9c33f4a6b..67f742f6d 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -398,6 +398,8 @@ "Common.Views.ReviewChanges.txtSpelling": "Spell Checking", "Common.Views.ReviewChanges.txtTurnon": "Track Changes", "Common.Views.ReviewChanges.txtView": "Display Mode", + "Common.Views.ReviewChanges.txtMarkupSimpleCap": "Simple Markup", + "Common.Views.ReviewChanges.txtMarkupSimple": "All changes (Editing)
Turn off pop-up windows with changes", "Common.Views.ReviewChangesDialog.textTitle": "Review Changes", "Common.Views.ReviewChangesDialog.txtAccept": "Accept", "Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes", From 2954b9ded51446302de5e0f81f707897b77bf853 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 4 Aug 2021 15:43:54 +0300 Subject: [PATCH 2/6] [DE] Add parameter review.hoverMode to customization: show review changes balloons as tooltips (on mouse move) --- apps/api/documents/api.js | 3 ++- apps/common/main/lib/controller/ReviewChanges.js | 10 +++++++++- .../main/app/view/DocumentHolder.js | 15 +++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 55d5e7bc1..c1a9abf26 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -136,7 +136,8 @@ label: string (default: "Guest") // postfix for user name }, review: { - hideReviewDisplay: false // hide button Review mode + hideReviewDisplay: false, // hide button Review mode + hoverMode: false // true - show review balloons on mouse move, not on click on text }, chat: true, comments: true, diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 549ed477f..9ba96dbaf 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -181,7 +181,7 @@ define([ onApiShowChange: function (sdkchange) { if (this.getPopover()) { - if (sdkchange && sdkchange.length>0) { + if (!this.appConfig.reviewHoverMode && sdkchange && sdkchange.length>0) { var i = 0, changes = this.readSDKChange(sdkchange), posX = sdkchange[0].get_X(), @@ -844,6 +844,14 @@ define([ me.view.btnCommentRemove && me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true)); me.view.btnCommentResolve && me.view.btnCommentResolve.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true)); } + + var val = Common.localStorage.getItem(me.view.appPrefix + "settings-review-hover-mode"); + if (val === null) { + val = me.appConfig.customization && me.appConfig.customization.review ? !!me.appConfig.customization.review.hoverMode : false; + } else + val = !!parseInt(val); + Common.Utils.InternalSettings.set(me.view.appPrefix + "settings-review-hover-mode", val); + me.appConfig.reviewHoverMode = val; }, showTips: function(strings) { diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index d087ec28f..3ae5290ee 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -491,7 +491,8 @@ define([ var showPoint, ToolTip, type = moveData.get_Type(); - if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink || type==Asc.c_oAscMouseMoveDataTypes.Footnote || type==Asc.c_oAscMouseMoveDataTypes.Form) { // 1 - hyperlink, 3 - footnote + if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink || type==Asc.c_oAscMouseMoveDataTypes.Footnote || type==Asc.c_oAscMouseMoveDataTypes.Form || + type==Asc.c_oAscMouseMoveDataTypes.Review && me.mode.reviewHoverMode) { if (isTooltipHiding) { mouseMoveData = moveData; return; @@ -511,12 +512,22 @@ define([ ToolTip = moveData.get_FormHelpText(); if (ToolTip.length>1000) ToolTip = ToolTip.substr(0, 1000) + '...'; + } else if (type==Asc.c_oAscMouseMoveDataTypes.Review) { + var changes = DE.getController("Common.Controllers.ReviewChanges").readSDKChange(moveData.asc_getChanges()); + if (changes && changes.length>0) + changes = changes[0]; + if (changes) { + ToolTip = ''+ Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(changes.get('username'))) +' '; + ToolTip += ''+ changes.get('date') +'
'; + ToolTip += changes.get('changetext'); + } } var recalc = false; screenTip.isHidden = false; - ToolTip = Common.Utils.String.htmlEncode(ToolTip); + if (type!==Asc.c_oAscMouseMoveDataTypes.Review) + ToolTip = Common.Utils.String.htmlEncode(ToolTip); if (screenTip.tipType !== type || screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) { screenTip.toolTip.setTitle((type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) ? (ToolTip + '
' + me.txtPressLink + '') : ToolTip); From a9c32f368e193318b59ba607e9c2bc7cfeb17be0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 10 Aug 2021 19:32:12 +0300 Subject: [PATCH 3/6] [DE] Use new methods for review display --- .../main/lib/controller/ReviewChanges.js | 48 ++++++++++++------- .../lib/controller/collaboration/Review.jsx | 31 +++++++----- 2 files changed, 48 insertions(+), 31 deletions(-) diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 9ba96dbaf..d2b6d7149 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -131,8 +131,7 @@ define([ this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this)); this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this)); this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this)); - this.api.asc_registerCallback('asc_onBeginViewModeInReview', _.bind(this.onBeginViewModeInReview, this)); - this.api.asc_registerCallback('asc_onEndViewModeInReview', _.bind(this.onEndViewModeInReview, this)); + this.api.asc_registerCallback('asc_onChangeDisplayModeInReview', _.bind(this.onChangeDisplayModeInReview, this)); } if (this.appConfig.canReview) this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this)); @@ -688,27 +687,40 @@ define([ turnDisplayMode: function(mode) { if (this.api) { - if (mode === 'final') - this.api.asc_BeginViewModeInReview(true); - else if (mode === 'original') - this.api.asc_BeginViewModeInReview(false); - else - this.api.asc_EndViewModeInReview(mode=='simple'); + var type = Asc.c_oAscDisplayModeInReview.Edit; + switch (mode) { + case 'final': + type = Asc.c_oAscDisplayModeInReview.Final; + break; + case 'original': + type = Asc.c_oAscDisplayModeInReview.Original; + break; + case 'simple': + type = Asc.c_oAscDisplayModeInReview.Simple; + break; + } + this.api.asc_SetDisplayModeInReview(type); } this.disableEditing(mode == 'final' || mode == 'original'); this._state.previewMode = (mode == 'final' || mode == 'original'); }, - onBeginViewModeInReview: function(mode) { - this.disableEditing(true); - this.view && this.view.turnDisplayMode(mode ? 'final' : 'original'); - this._state.previewMode = true; - }, - - onEndViewModeInReview: function(mode) { - this.disableEditing(false); - this.view && this.view.turnDisplayMode(mode ? 'simple' : 'markup'); - this._state.previewMode = false; + onChangeDisplayModeInReview: function(type) { + this.disableEditing(type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original); + var mode = 'markup'; + switch (type) { + case Asc.c_oAscDisplayModeInReview.Final: + mode = 'final'; + break; + case Asc.c_oAscDisplayModeInReview.Original: + mode = 'original'; + break; + case Asc.c_oAscDisplayModeInReview.Simple: + mode = 'simple'; + break; + } + this.view && this.view.turnDisplayMode(mode); + this._state.previewMode = (type===Asc.c_oAscDisplayModeInReview.Final || type===Asc.c_oAscDisplayModeInReview.Original); }, isPreviewChangesMode: function() { diff --git a/apps/common/mobile/lib/controller/collaboration/Review.jsx b/apps/common/mobile/lib/controller/collaboration/Review.jsx index 507c0d850..c12596ba9 100644 --- a/apps/common/mobile/lib/controller/collaboration/Review.jsx +++ b/apps/common/mobile/lib/controller/collaboration/Review.jsx @@ -31,14 +31,16 @@ class InitReview extends Component { if (viewReviewMode === null) viewReviewMode = appOptions.customization && /^(original|final|markup|simple)$/i.test(appOptions.customization.reviewDisplay) ? appOptions.customization.reviewDisplay.toLocaleLowerCase() : ( appOptions.isEdit || appOptions.isRestrictedEdit ? 'markup' : 'original'); let displayMode = viewReviewMode.toLocaleLowerCase(); - if (displayMode === 'final') { - api.asc_BeginViewModeInReview(true); - } else if (displayMode === 'original') { - api.asc_BeginViewModeInReview(false); - } else { - (displayMode === 'simple') && (displayMode = 'markup'); - api.asc_EndViewModeInReview(); + let type = Asc.c_oAscDisplayModeInReview.Edit; + switch (displayMode) { + case 'final': + type = Asc.c_oAscDisplayModeInReview.Final; + break; + case 'original': + type = Asc.c_oAscDisplayModeInReview.Original; + break; } + api.asc_SetDisplayModeInReview(type); props.storeReview.changeDisplayMode(displayMode); } }); @@ -95,13 +97,16 @@ class Review extends Component { onDisplayMode (mode) { const api = Common.EditorApi.get(); - if (mode === 'final') { - api.asc_BeginViewModeInReview(true); - } else if (mode === 'original') { - api.asc_BeginViewModeInReview(false); - } else { - api.asc_EndViewModeInReview(); + let type = Asc.c_oAscDisplayModeInReview.Edit; + switch (mode) { + case 'final': + type = Asc.c_oAscDisplayModeInReview.Final; + break; + case 'original': + type = Asc.c_oAscDisplayModeInReview.Original; + break; } + api.asc_SetDisplayModeInReview(type); !this.appConfig.isEdit && !this.appConfig.isRestrictedEdit && LocalStorage.setItem("de-view-review-mode", mode); this.props.storeReview.changeDisplayMode(mode); } From c69e2cb6953247dbad0206be95088808958f274a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 11 Aug 2021 14:03:08 +0300 Subject: [PATCH 4/6] [DE] Refactoring review tips --- apps/documenteditor/main/app/view/DocumentHolder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 3ae5290ee..9566d0c48 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -512,8 +512,8 @@ define([ ToolTip = moveData.get_FormHelpText(); if (ToolTip.length>1000) ToolTip = ToolTip.substr(0, 1000) + '...'; - } else if (type==Asc.c_oAscMouseMoveDataTypes.Review) { - var changes = DE.getController("Common.Controllers.ReviewChanges").readSDKChange(moveData.asc_getChanges()); + } else if (type==Asc.c_oAscMouseMoveDataTypes.Review && moveData.get_ReviewChange()) { + var changes = DE.getController("Common.Controllers.ReviewChanges").readSDKChange([moveData.get_ReviewChange()]); if (changes && changes.length>0) changes = changes[0]; if (changes) { From 6c5f96b75bb298cfdd36ea6d0bc93f769693df46 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 11 Aug 2021 15:39:32 +0300 Subject: [PATCH 5/6] Change translation --- apps/common/main/lib/view/ReviewChanges.js | 2 +- apps/documenteditor/main/locale/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index d30a0448b..4b9e4f3ce 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -862,7 +862,7 @@ define([ textWarnTrackChanges: 'Track Changes will be switched ON for all users with full access. The next time anyone opens the doc, Track Changes will remain enabled.', textEnable: 'Enable', txtMarkupSimpleCap: 'Simple Markup', - txtMarkupSimple: 'All changes (Editing)
Turn off pop-up windows with changes' + txtMarkupSimple: 'All changes (Editing)
Turn off balloons' } }()), Common.Views.ReviewChanges || {})); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 67f742f6d..1f3fff994 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -399,7 +399,7 @@ "Common.Views.ReviewChanges.txtTurnon": "Track Changes", "Common.Views.ReviewChanges.txtView": "Display Mode", "Common.Views.ReviewChanges.txtMarkupSimpleCap": "Simple Markup", - "Common.Views.ReviewChanges.txtMarkupSimple": "All changes (Editing)
Turn off pop-up windows with changes", + "Common.Views.ReviewChanges.txtMarkupSimple": "All changes (Editing)
Turn off balloons", "Common.Views.ReviewChangesDialog.textTitle": "Review Changes", "Common.Views.ReviewChangesDialog.txtAccept": "Accept", "Common.Views.ReviewChangesDialog.txtAcceptAll": "Accept All Changes", From cfd56386468167e72d0a82f337ed4765cee03254 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 13 Aug 2021 14:32:32 +0300 Subject: [PATCH 6/6] [DE] Fix review balloon position --- apps/common/main/lib/controller/Comments.js | 3 +- .../main/lib/controller/ReviewChanges.js | 3 +- apps/common/main/lib/view/ReviewPopover.js | 51 ++++++++++++++++++- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index fda45bab8..260c22e61 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -1185,7 +1185,8 @@ define([ renderTo : this.sdkViewName, canRequestUsers: (this.mode) ? this.mode.canRequestUsers : undefined, canRequestSendNotify: (this.mode) ? this.mode.canRequestSendNotify : undefined, - mentionShare: (this.mode) ? this.mode.mentionShare : true + mentionShare: (this.mode) ? this.mode.mentionShare : true, + api: this.api }); this.popover.setCommentsStore(this.popoverComments); } diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index d2b6d7149..94356c9b6 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -255,7 +255,8 @@ define([ if ((this.appConfig.canReview || this.appConfig.canViewReview) && _.isUndefined(this.popover)) { this.popover = Common.Views.ReviewPopover.prototype.getPopover({ reviewStore : this.popoverChanges, - renderTo : this.sdkViewName + renderTo : this.sdkViewName, + api: this.api }); this.popover.setReviewStore(this.popoverChanges); } diff --git a/apps/common/main/lib/view/ReviewPopover.js b/apps/common/main/lib/view/ReviewPopover.js index 759c2debe..a4ffc454e 100644 --- a/apps/common/main/lib/view/ReviewPopover.js +++ b/apps/common/main/lib/view/ReviewPopover.js @@ -103,6 +103,7 @@ define([ this.canRequestUsers = options.canRequestUsers; this.canRequestSendNotify = options.canRequestSendNotify; this.mentionShare = options.mentionShare; + this.api = options.api; this.externalUsers = []; this._state = {commentsVisible: false, reviewVisible: false}; @@ -784,7 +785,7 @@ define([ } } } - if (!retainContent) + if (!retainContent || this.isOverCursor()) this.calculateSizeOfContent(); }, calculateSizeOfContent: function (testVisible) { @@ -839,7 +840,34 @@ define([ outerHeight = Math.max(commentsView.outerHeight(), this.$window.outerHeight()); - if (sdkBoundsHeight <= outerHeight) { + var movePos = this.isOverCursor(); + if (movePos) { + var newTopDown = movePos[1] + sdkPanelHeight,// try move down + newTopUp = movePos[0] + sdkPanelHeight; // try move up + if (newTopDown + outerHeight>sdkBoundsTop + sdkBoundsHeight) { + var diffDown = sdkBoundsTop + sdkBoundsHeight - newTopDown; + if (newTopUp - outerHeightleftPos && x0leftPos && x1