From: Fomafix Date: Wed, 5 Jun 2019 19:33:41 +0000 (+0200) Subject: jquery.suggestions: Use document.documentElement.clientWidth X-Git-Tag: 1.34.0-rc.0~1478^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/%28%5B%5E/%40lib_url%40?a=commitdiff_plain;h=578c8e6855ca3888dc2214138b1d31b57ceedf1c;p=lhc%2Fweb%2Fwiklou.git jquery.suggestions: Use document.documentElement.clientWidth On skins with a border and/or a margin on the or the element the width of is smaller than the width of the window. Also use .appendTo( document.body ) instead of .appendTo( $( 'body' ) ). Bug: T47668 Change-Id: I209eb6e3b95ba0fc6e7c5084242a90ca04c9e196 --- diff --git a/resources/src/jquery/jquery.suggestions.js b/resources/src/jquery/jquery.suggestions.js index 4a1d637de9..964f5d06d5 100644 --- a/resources/src/jquery/jquery.suggestions.js +++ b/resources/src/jquery/jquery.suggestions.js @@ -415,7 +415,8 @@ } else { // Expand from right newCSS.left = 'auto'; - newCSS.right = $( 'body' ).width() - ( regionPosition.left + context.config.$region.outerWidth() ); + newCSS.right = document.documentElement.clientWidth - + ( regionPosition.left + context.config.$region.outerWidth() ); } context.data.$container.css( newCSS ); @@ -722,7 +723,7 @@ ); } ) ) - .appendTo( $( 'body' ) ); + .appendTo( document.body ); $( this ) // Stop browser autocomplete from interfering