jquery.textSelection: Don't throw errors on empty collections
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 25 Apr 2014 13:13:56 +0000 (15:13 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 25 Apr 2014 13:38:11 +0000 (15:38 +0200)
commit2828669dd40f63f60c2391b6d5ee30a3e255f3db
treef46dc785a037940cc1f5c78861453fbbf6aab206
parent1d00b757fc894d93624cd53121aa274118f17cb2
jquery.textSelection: Don't throw errors on empty collections

All jQuery functions just do nothing or return "empty" values when
called on an empty collection (e.g. `$()`), the ones defined in this
module should behave in the same way.

This came to light when a change in WikiEditor combined with lousy
coding caused this code path to be called, breaking various gadgets
and extensions like SemanticForms.

Bug: 64289
Change-Id: Ib97f47ef1d66420682bd429c9c12e66c3392e77d
resources/src/jquery/jquery.textSelection.js