Skip to content

Commit

Permalink
[PDF] Fix Bug 69744
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Oct 24, 2024
1 parent 29f59e0 commit 637121f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apps/pdfeditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ define([
me.showMathTrackOnLoad = false;
me.lastTextBarBounds = [];
me.lastAnnotBarBounds = [];
me.lastAnnotBarOnTop = true;

me.screenTip = {
toolTip: new Common.UI.Tooltip({
Expand Down Expand Up @@ -2762,7 +2763,7 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
},

onShowAnnotBar: function(bounds) {
onShowAnnotBar: function(bounds, mouseOnTop) {
if (this.mode && !this.mode.isEdit) return;

if (_.isUndefined(this._XY)) {
Expand All @@ -2776,6 +2777,7 @@ define([
}

this.lastAnnotBarBounds = bounds;
(mouseOnTop!==undefined) && (this.lastAnnotBarOnTop = mouseOnTop);
if (bounds[3] < 0 || bounds[1] > this._Height || !Common.Utils.InternalSettings.get('pdfe-settings-annot-bar')) {
this.onHideAnnotBar();
return;
Expand Down Expand Up @@ -2813,11 +2815,8 @@ define([
this.api.UpdateInterfaceState();
}

var showPoint = [(bounds[0] + bounds[2])/2 - textContainer.outerWidth()/2, bounds[1] - textContainer.outerHeight() - 10];
var showPoint = [(bounds[0] + bounds[2])/2 - textContainer.outerWidth()/2, me.lastAnnotBarOnTop ? bounds[1] - textContainer.outerHeight() - 10 : bounds[3] + 10];
(showPoint[0]<0) && (showPoint[0] = 0);
if (showPoint[1]<0) {
showPoint[1] = (bounds[3] > me._Height) ? 0 : bounds[3] + 10;
}
showPoint[1] = Math.min(me._Height - textContainer.outerHeight(), Math.max(0, showPoint[1]));
textContainer.css({left: showPoint[0], top : showPoint[1]});

Expand Down

0 comments on commit 637121f

Please sign in to comment.