Skip to content

Commit

Permalink
IBX-1062: Corrected set position for confirm popup for link (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszdebinski authored Nov 5, 2021
1 parent 9bda28b commit a5c8333
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@ export default class EzLinkConfig extends EzConfigButtonsBase {
const domElement = new CKEDITOR.dom.element(ReactDOM.findDOMNode(this));
const region = payload.selectionData.region;
const xy = this.getWidgetXYPoint(region.left, region.top, CKEDITOR.SELECTION_BOTTOM_TO_TOP);
const elementWidth = domElement.$.offsetWidth;
const parentWidth = domElement.$.parentElement.offsetWidth;
const width = elementWidth + xy[0];
let moveLeft = xy[0];

if (parentWidth <= width) {
moveLeft = (parentWidth - elementWidth) - 10;
}

domElement.addClass('ae-toolbar-transition');
domElement.setStyles({ left: xy[0] + 'px', top: xy[1] + 'px' });
domElement.setStyles({ left: moveLeft + 'px', top: xy[1] + 'px' });

return true;
}
Expand Down

0 comments on commit a5c8333

Please sign in to comment.