| 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 2081f9956cd9d28ed7f9812ebcd43d2f16a6a8f6..effd8e87791165b2cc6ed6268eb31971bfe1c7b5 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
|
| @@ -82,8 +82,9 @@ UI.SoftContextMenu = class {
|
| }
|
|
|
| // Re-position menu in case it does not fit.
|
| - var hostLeft = UI.Dialog.modalHostView().element.totalOffsetLeft();
|
| - var hostRight = hostLeft + UI.Dialog.modalHostView().element.offsetWidth;
|
| + var overlayRoot = UI.ModalOverlay.rootElement();
|
| + var hostLeft = overlayRoot.totalOffsetLeft();
|
| + var hostRight = hostLeft + overlayRoot.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;
|
| @@ -92,13 +93,12 @@ UI.SoftContextMenu = class {
|
|
|
| // Move submenus upwards if it does not fit.
|
| if (this._parentMenu && document.body.offsetHeight < this.element.offsetTop + this.element.offsetHeight) {
|
| - y = Math.max(
|
| - UI.Dialog.modalHostView().element.totalOffsetTop(), document.body.offsetHeight - this.element.offsetHeight);
|
| + y = Math.max(overlayRoot.totalOffsetTop(), document.body.offsetHeight - this.element.offsetHeight);
|
| this.element.style.top = y + 'px';
|
| }
|
|
|
| - var maxHeight = UI.Dialog.modalHostView().element.offsetHeight;
|
| - maxHeight -= y - UI.Dialog.modalHostView().element.totalOffsetTop();
|
| + var maxHeight = overlayRoot.offsetHeight;
|
| + maxHeight -= y - overlayRoot.totalOffsetTop();
|
| this.element.style.maxHeight = maxHeight + 'px';
|
|
|
| this._focus();
|
|
|