diff --git a/apps/common/main/lib/view/ReviewPopover.js b/apps/common/main/lib/view/ReviewPopover.js index 3c12292251..6d080aa2b0 100644 --- a/apps/common/main/lib/view/ReviewPopover.js +++ b/apps/common/main/lib/view/ReviewPopover.js @@ -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); @@ -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) { @@ -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; } @@ -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 { @@ -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); } } } diff --git a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js index 723d3c14e6..57e72d7157 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js @@ -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'