nostalgiaz/bootstrap-toggle-buttons — pull request #41 by shmeeps (2012-11-21 18:05:37+00:00)
Title: Removed global jQuery selectors to reduce multiple-event binding

This commit removes the global jQuery selectors from the script. These selectors would pick up on every toggle button that existed, meaning that having multiple toggle buttons on the same page had the possibility of binding the onChange callback to it's toggle button multiple times.

This change also negates the need for `e.preventDefault()` and `e.stopImmediatePropagation()`, which allows for outside scripts to bind on the hidden checkbox's `change` event without affecting the functionality of the toggle buttons.