Last modified: 2011-05-14 17:56:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30978, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28978 - jquery.autoEllipsis cache doesn't take position into account
jquery.autoEllipsis cache doesn't take position into account
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-14 17:10 UTC by Roan Kattouw
Modified: 2011-05-14 17:56 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2011-05-14 17:10:10 UTC
<div style="width:100px">
<div id="foo">This is a really long sentence that doesn't fit in here at all without wrapping</div>
<div id="bar">This is a really long sentence that doesn't fit in here at all without WRAPPING</div>
<div id="baz">This is a really long sentence that doesn't fit in here at all without wrapping</div>
</div>

Run:

$('#foo').autoEllipsis(); // foo is trimmed in the middle
$('#bar').autoEllipsis({position:'right'}); // bar is trimmed at the end
$('#baz').autoEllipsis({position:'right'}); // baz is trimmed IN THE MIDDLE, that's wrong

The reason this happens is that autoEllipsis caches the ellipsized version of the string without taking the position option into account. #foo and #baz have the exact same text, so the cache entry is (wrongly) reused.
Comment 1 Roan Kattouw 2011-05-14 17:56:13 UTC
Fixed in r88115

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links