From 578c8e6855ca3888dc2214138b1d31b57ceedf1c Mon Sep 17 00:00:00 2001 From: Fomafix Date: Wed, 5 Jun 2019 21:33:41 +0200 Subject: [PATCH] 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 --- resources/src/jquery/jquery.suggestions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.20.1