Skip to content

Commit

Permalink
Merge pull request 'fix/bugfix' (#97) from fix/bugfix into hotfix/v8.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia Radzhabova committed Oct 24, 2024
2 parents 2022414 + 86b6684 commit 20b9288
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
37 changes: 25 additions & 12 deletions apps/common/main/lib/view/ReviewPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ define([
this.canRequestSendNotify = options.canRequestSendNotify;
this.mentionShare = options.mentionShare;
this.api = options.api;
this._state = {commentsVisible: false, reviewVisible: false};
this._state = {commentsVisible: false, reviewVisible: false, arrowCls: 'left'};
this.isDocEditor = !!window.DE;

_options.tpl = _.template(this.template)(_options);

Expand Down Expand Up @@ -777,6 +778,13 @@ define([
// LEFT CORNER

if (!_.isUndefined(posX)) {
let isOnSheet = !_.isUndefined(leftX),
isRtl = isOnSheet ? posX < leftX : Common.UI.isRTL();
if (isOnSheet && isRtl) {
let tmp = posX;
posX = leftX;
leftX = tmp;
}

sdkPanelRight = $('#id_vertical_scroll');
if (sdkPanelRight.length) {
Expand All @@ -800,23 +808,28 @@ define([
this.sdkBounds.width -= sdkPanelThumbsWidth;
}

if (!Common.UI.isRTL()) {
if (!isRtl) {
leftPos = Math.min(sdkBoundsLeft + posX + this.arrow.width, sdkBoundsLeft + this.sdkBounds.width - this.$window.outerWidth() - 25);
leftPos = Math.max(sdkBoundsLeft + sdkPanelLeftWidth + this.arrow.width, leftPos);
} else {
} else if (this.isDocEditor) {
leftPos = Math.max(sdkBoundsLeft + sdkPanelLeftWidth + 25, sdkBoundsLeft + this.sdkBounds.width - this.$window.outerWidth() - posX + 7);
leftPos = Math.min(sdkBoundsLeft + this.sdkBounds.width - this.$window.outerWidth() - 25, leftPos);
} else {
leftPos = Math.max(sdkBoundsLeft + sdkPanelLeftWidth, sdkBoundsLeft + posX - this.$window.outerWidth() - this.arrow.width - 25);
leftPos = Math.min(sdkBoundsLeft + this.sdkBounds.width - this.$window.outerWidth() - 25, leftPos);
}

arrowView.removeClass('right top bottom').addClass('left');
this._state.arrowCls = isOnSheet && Common.UI.isRTL() ? 'right' : 'left';
arrowView.removeClass('right top bottom').addClass(this._state.arrowCls);
arrowView.css({left: ''});

if (!_.isUndefined(leftX)) {
if (isOnSheet) {
windowWidth = this.$window.outerWidth();
if (windowWidth) {
if ((posX + windowWidth > this.sdkBounds.width - this.arrow.width + 5) && (this.leftX > windowWidth) || (Common.UI.isRTL() && sdkBoundsLeft + this.leftX > windowWidth + this.arrow.width)) {
leftPos = sdkBoundsLeft + this.leftX - windowWidth - this.arrow.width;
arrowView.removeClass('left').addClass('right');
if ((posX + windowWidth > this.sdkBounds.width - this.arrow.width + 5) && (leftX > windowWidth) || (isRtl && sdkBoundsLeft + leftX > windowWidth + this.arrow.width)) {
leftPos = sdkBoundsLeft + leftX - windowWidth - this.arrow.width;
this._state.arrowCls = Common.UI.isRTL() ? 'left' : 'right';
arrowView.removeClass('left right').addClass(this._state.arrowCls);
} else {
leftPos = sdkBoundsLeft + posX + this.arrow.width;
}
Expand Down Expand Up @@ -963,8 +976,8 @@ define([
arrowPosY = Math.min(arrowPosY, sdkBoundsHeight - (sdkPanelHeight + this.arrow.margin + this.arrow.height));

arrowView.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
arrowView.removeClass('top bottom right left');
arrowView.addClass(this._state.arrowCls);
this.scroller.scrollTop(scrollPos);
} else {

Expand All @@ -983,8 +996,8 @@ define([
arrowPosY = Math.min(arrowPosY, outerHeight - this.arrow.margin - this.arrow.height);

arrowView.css({top: arrowPosY + 'px', left: ''});
arrowView.removeClass('top bottom right');
arrowView.addClass('left');
arrowView.removeClass('top bottom right left');
arrowView.addClass(this._state.arrowCls);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ define([
this.btnsCategory[4].setDisabled(null === margins); // Margins

var shapetype = props.asc_getType();
this.btnsCategory[5].setDisabled(props.get_FromSmartArtInternal()
this.btnsCategory[5].setDisabled(props.get_FromSmartArtInternal() || props.get_FromSmartArt()
|| shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
Expand Down

0 comments on commit 20b9288

Please sign in to comment.