https://bugzilla.wikimedia.org/show_bug.cgi?id=28978

       Web browser: ---
             Bug #: 28978
           Summary: jquery.autoEllipsis cache doesn't take position into
                    account
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Javascript
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


<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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to