Bug 850335 - Don't position Metro context menus past the edge of the screen [r=mbrubeck]

--HG--
extra : rebase_source : 630fa09104fd3f90d17736fe09faed73ae7bf676
This commit is contained in:
Rodrigo Silveira 2013-03-12 16:33:49 -07:00
parent 0c7ce7925f
commit 58d00e486e

View File

@ -454,8 +454,11 @@ MenuPopup.prototype = {
}
}
if (aX < 0)
if (aX < 0) {
aX = 0;
} else if (aX + width + kPositionPadding > screenWidth){
aX = screenWidth - width - kPositionPadding;
}
if (aY < 0 && aPositionOptions.moveBelowToFit) {
// show context menu below when it doesn't fit.