Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1148)

Unified Diff: chrome/browser/resources/shared/js/cr/ui/position_util.js

Issue 3315005: NTP: Adds a context menu to the apps section... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/command.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/position_util.js
===================================================================
--- chrome/browser/resources/shared/js/cr/ui/position_util.js (revision 58563)
+++ chrome/browser/resources/shared/js/cr/ui/position_util.js (working copy)
@@ -57,10 +57,15 @@
*/
function positionPopupAroundRect(anchorRect, popupElement, type) {
var popupRect = popupElement.getBoundingClientRect();
- var popupContainer = popupElement.offsetParent;
+ var popupContainer;
+ var cs = popupElement.ownerDocument.defaultView.
+ getComputedStyle(popupElement);
+ if (cs.position == 'fixed')
+ popupContainer = popupElement.ownerDocument.body;
+ else
+ popupContainer = popupElement.offsetParent;
var availRect = popupContainer.getBoundingClientRect();
- var rtl = popupElement.ownerDocument.defaultView.
- getComputedStyle(popupElement).direction == 'rtl';
+ var rtl = cs.direction == 'rtl';
// Flip BEFORE, AFTER based on RTL.
if (rtl) {
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/command.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698