From 95be0dfa0f4affbb753ea78c83acdc7ad7b2e3c9 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Wed, 15 Jun 2011 23:09:41 -0400 Subject: [PATCH] Bug 664114 - Context Menu doesn't resize properly when switching the window orientation [r=wjohnston] --- mobile/chrome/content/MenuListHelperUI.js | 5 +++-- mobile/chrome/content/browser.xul | 2 +- mobile/chrome/content/common-ui.js | 5 +++-- mobile/themes/core/browser.css | 8 ++++++++ mobile/themes/core/defines.inc | 2 ++ mobile/themes/core/gingerbread/browser.css | 13 +++++++++++++ mobile/themes/core/gingerbread/defines.inc | 2 ++ mobile/themes/core/gingerbread/platform.css | 8 ++++---- mobile/themes/core/platform.css | 2 +- 9 files changed, 37 insertions(+), 10 deletions(-) diff --git a/mobile/chrome/content/MenuListHelperUI.js b/mobile/chrome/content/MenuListHelperUI.js index 892660088f8..d384c2fca84 100644 --- a/mobile/chrome/content/MenuListHelperUI.js +++ b/mobile/chrome/content/MenuListHelperUI.js @@ -59,8 +59,8 @@ var MenuListHelperUI = { } window.addEventListener("resize", this, true); - container.hidden = false; this.sizeToContent(); + container.hidden = false; BrowserUI.pushPopup(this, [this._popup]); }, @@ -86,7 +86,8 @@ var MenuListHelperUI = { }, sizeToContent: function sizeToContent() { - this._popup.width = window.innerWidth * 0.8; + let style = document.defaultView.getComputedStyle(this._container, null); + this._popup.width = window.innerWidth - (parseInt(style.paddingLeft) + parseInt(style.paddingRight)); }, handleEvent: function handleEvent(aEvent) { diff --git a/mobile/chrome/content/browser.xul b/mobile/chrome/content/browser.xul index 8bf3d4923ba..a784a645b36 100644 --- a/mobile/chrome/content/browser.xul +++ b/mobile/chrome/content/browser.xul @@ -597,7 +597,7 @@ -