Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/135309
Change subject: jquery.suggestions: Handle CSS ellipsis better for IE
......................................................................
jquery.suggestions: Handle CSS ellipsis better for IE
IE is not impressed by our puny hacks and still reports the width
"in context of" the position in the document, limited by the width
of ancestor elements.
Let's temporarily apply position: absolute; to the involved elements.
This pulls them out of normal document flow and lets us figure out the
real width at last.
Verified that this fixes:
* IE 8
* IE 11
Verified that it doesn't break:
* Firefox 3.6
* Firefox 29
* Opera 12
* Opera 22
It *does not* fix IE 6. I don't think that investigating why is a good
use of my time, so I didn't. I84fbae5a will make the functionality
usable on IE 6, which feels good enough for me.
Bug: 65224
Change-Id: I4a7357543ca244585ade2061b92f5a6d1e439278
---
M resources/src/jquery/jquery.suggestions.js
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/09/135309/1
diff --git a/resources/src/jquery/jquery.suggestions.js
b/resources/src/jquery/jquery.suggestions.js
index a20a948..db4f415 100644
--- a/resources/src/jquery/jquery.suggestions.js
+++ b/resources/src/jquery/jquery.suggestions.js
@@ -269,7 +269,7 @@
// Widen results box if
needed (new width is only calculated here, applied later).
// We need this awful
hack to calculate the actual pre-ellipsis width.
$spanForWidth =
$result.wrapInner( '<span>' ).children();
- childrenWidth =
$spanForWidth.outerWidth();
+ childrenWidth =
$spanForWidth.css( 'position', 'absolute' ).outerWidth();
$spanForWidth.contents().unwrap();
if ( childrenWidth >
$result.width() && childrenWidth > expWidth ) {
// factor in
any padding, margin, or border space on the parent
--
To view, visit https://gerrit.wikimedia.org/r/135309
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a7357543ca244585ade2061b92f5a6d1e439278
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits