mdbootstrap / bootstrap-toggle-buttons

Bootstrap-toggle-buttons has moved to https://github.com/nostalgiaz/bootstrap-switch
https://github.com/nostalgiaz/bootstrap-switch
Apache License 2.0
1.02k stars 92 forks source link

Allow status to be queried programatically #33

Closed LeeMallabone closed 11 years ago

LeeMallabone commented 11 years ago

Allow developers to query the toggle status without knowing the details of the wrapped checkbox. This permits code like: $('#foo').toggleButtons('status') // returns truthy if the toggle is active, falsey otherwise.

nostalgiaz commented 11 years ago

I cloned your repo and I tried your patch... but... it doesn't work :(

$('#foo').toggleButtons('status')  // "checked" or undefined, not true or false.

Change your code in this way and it works!

$('#normal-toggle-button').find('input:checkbox').is(':checked');

Then send me a pull request, ok? :D