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