| Index: third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
|
| index f647177b3f1191fd104fcc2473ba27d8a4197673..447bf9ee8954331ddfd770db19be7a25d8886d2e 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
|
| @@ -82,13 +82,12 @@ UI.SoftContextMenu = class {
|
| }
|
|
|
| // Re-position menu in case it does not fit.
|
| - if (document.body.offsetWidth < this.element.offsetLeft + this.element.offsetWidth) {
|
| - this.element.style.left =
|
| - Math.max(
|
| - UI.Dialog.modalHostView().element.totalOffsetLeft(), this._parentMenu ?
|
| - this._parentMenu.element.offsetLeft - this.element.offsetWidth + subMenuOverlap :
|
| - document.body.offsetWidth - this.element.offsetWidth) +
|
| - 'px';
|
| + var hostLeft = UI.Dialog.modalHostView().element.totalOffsetLeft();
|
| + var hostRight = hostLeft + UI.Dialog.modalHostView().element.offsetWidth;
|
| + if (hostRight < this.element.offsetLeft + this.element.offsetWidth) {
|
| + var left = this._parentMenu ? this._parentMenu.element.offsetLeft - this.element.offsetWidth + subMenuOverlap :
|
| + hostRight - this.element.offsetWidth;
|
| + this.element.style.left = Math.max(hostLeft, left) + 'px';
|
| }
|
|
|
| // Move submenus upwards if it does not fit.
|
|
|