ivaynberg/select2 — pull request #232 by ProLoser (2012-07-18 01:02:05+00:00)
Title: Added opts to initSelection() parameters

I am not sure how useful this really is, so you're completely free to close this without merging as it was more of a convenience factor I had in a local version.

By passing `this.opts` as the third parameter to `initSelection()` it allows me to see things like if multiple is true, retrieve the ajax url, and reuse other formatter functions without having to explicitly call those variables or introspect the source element.

The problem is that the dev might modify this object and thereby make breaking changes, however I figured that edge-case was so obscure I'd rather just show a warning on the docs than bother cloning the options.

The new signature is: `initSelection(element, callback, opts)` where `opts` is the result of the passed options merged onto defaults with additional calculated options.