silviomoreto/bootstrap-select — pull request #18 by caseyjhol (2012-12-04 11:55:36+00:00)
Title: Pull request - lots of changes

This started out as me making a few minor changes, but turned into a bigger project than I'd originally intended. See an [example](http://caseyjhol.github.com/bootstrap-select/) with all of my changes. Here's the rundown to my knowledge:

I changed the wrap tag to `````` instead of ``````. This is a little bit cleaner - also there was an extraneous ```'``` in the tag.

Any classes added to the ```select```, such as ```.span*```, are now added to ```.btn-group``` and the width of of ```.btn``` is set to 100%. This gives proper Bootstrap appearance (as of now ```.span*``` is added to the button, giving the button a percentage width of its container, ```.btn-group```, often causing an undesired look. Other classes can still be added to the button by setting `style` in the options or via the new ```data-style``` attribute. When the select is disabled, the ```.disabled``` class is now added to ```.btn``` itself, rather than ```.btn-group```. I set the default width of ```.btn-group``` so it matches the default Bootstrap ```select``` width.

I also added a new ```data-size``` attribute, which allows you to choose how many items to show in the menu by default. The `ul` menu is now wrapped in a `div` for this feature to work.

I fixed issue #16 and changed the way the options are selected in the process (now using `.prop('selected', true)` instead of `setAttribute`). This is ultimately fewer lines of code and seems to work better for me (I was having issues in Chrome). There's a lot here - perhaps too much for a pull-request, but this now does nearly everything I need it to.