jquery.suggestions: Use document width instead of <body> width for position calculation
authorMatmaRex <matma.rex@gmail.com>
Wed, 10 Jul 2013 13:10:19 +0000 (15:10 +0200)
committerMatmaRex <matma.rex@gmail.com>
Wed, 10 Jul 2013 13:10:27 +0000 (15:10 +0200)
commit4d799b48289ac06f1e5ad77fa6dbe431597b6ab7
treef8aa191a2758687428c39e7ac7efcb0c83ed6492
parent5caa737fb7ec4c0da5a3a99905e14e93b2e324c6
jquery.suggestions: Use document width instead of <body> width for position calculation

Almost always, $( 'body' ).width() == $( document ).width(). (This is
the case for all core skins, for example.) However, it is technically
possible to give <body> a width or large margins and break that
assumption, so one of these should be used consistently.

Document width is better here because we're using it to do absolute
positioning, and usually it's relative to the viewport (ie., document
width). This will still break if someone decides to give their <body>
a position: absolute, but that would be quite insane, so let's not
bother.

Bug: 45668
Change-Id: Ib96d1c5c3591495623933e1aa4266b0f13432610
resources/jquery/jquery.suggestions.js