Fix up various issues leading to bug 40780.
authorTimo Tijhof <ttijhof@wikimedia.org>
Wed, 10 Oct 2012 02:23:30 +0000 (04:23 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 13 Oct 2012 22:10:07 +0000 (22:10 +0000)
commitec9296e0a89b8a3a3fb69543c7edb5f2adb3fd8f
tree1be6cbdaa50619e79f13ab0360a3aebe083acbd1
parent27013f18ea2115b60b9f5e115e99798f1258d90b
Fix up various issues leading to bug 40780.

* jquery.autoEllipsis didn't return 'this', which means whenever it
  was used in a chain, it would return undefined.

  So in mediawiki.searchSuggest append( ... autoEllipsis() ) would
  apply it to a detached node that stays detached because it
  isn't passed to append.

* Remove redundant passing of this in jQuery context to $().
  On jQuery.prototype, 'this' is obviously a jQuery object. In
  jquery.highlightText, which is called from jquery.autoEllipsis.

* Remove redundant .empty() call before calling .text( .. ),
  .text() replaces all content and naturally is forced to empty
  the element first.

* Merge use of $el and $container in jquery.autoEllipsis.js. They
  were both pointing to the same object, having two names was only
  confusing.

* Spaces.

Change-Id: I4649ec0c89d38c4d79d1dceec28227902cd48d32
resources/jquery/jquery.autoEllipsis.js
resources/jquery/jquery.highlightText.js
resources/mediawiki/mediawiki.searchSuggest.js