jquery.suggestions: Use body width instead of full document width
authorFomafix <fomafix@googlemail.com>
Tue, 29 Apr 2014 19:02:30 +0000 (19:02 +0000)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 16 May 2014 17:42:30 +0000 (17:42 +0000)
When there is a overflowing element in the content, the width of
the "document" is wider than the visible width within the browser
window. Use <body> instead of document.

This reverts 4d799b48 (a fix for bug 45668).

Bug: 54091
Bug: 64233
Change-Id: I5268eaf7307159b2eaa4c5749346aa562574a6e2

resources/src/jquery/jquery.suggestions.js

index 7d200ff..e395a51 100644 (file)
@@ -232,7 +232,7 @@ $.suggestions = {
                                                } else {
                                                        // Expand from right
                                                        newCSS.left = 'auto';
-                                                       newCSS.right = $( document ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
+                                                       newCSS.right = $( 'body' ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
                                                }
 
                                                context.data.$container.css( newCSS );