diff options
| author | Zac Echola <[email protected]> | 2015-04-28 09:45:16 -0500 |
|---|---|---|
| committer | Zac Echola <[email protected]> | 2015-04-28 09:45:16 -0500 |
| commit | 407e8dc9d8d8e28d456a37d9d69e1d3c89d6fbb4 (patch) | |
| tree | d841221f51dd9852fbce1c562127158d35b8812d /js/button.js | |
| parent | e46c998316359f3368d80736d7eb750d85dc4da5 (diff) | |
| parent | e6438592e9ea28324ba1a4344e724cab28032208 (diff) | |
| download | bootstrap-407e8dc9d8d8e28d456a37d9d69e1d3c89d6fbb4.tar.xz bootstrap-407e8dc9d8d8e28d456a37d9d69e1d3c89d6fbb4.zip | |
Merge branch 'master' of https://github.com/twbs/bootstrap into list_group_buttons
Diffstat (limited to 'js/button.js')
| -rw-r--r-- | js/button.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/button.js b/js/button.js index 7c7c021f9..8716aff4f 100644 --- a/js/button.js +++ b/js/button.js @@ -31,7 +31,7 @@ var val = $el.is('input') ? 'val' : 'html' var data = $el.data() - state = state + 'Text' + state += 'Text' if (data.resetText == null) $el.data('resetText', $el[val]()) @@ -56,8 +56,8 @@ if ($parent.length) { var $input = this.$element.find('input') if ($input.prop('type') == 'radio') { - if ($input.prop('checked') && this.$element.hasClass('active')) changed = false - else $parent.find('.active').removeClass('active') + if ($input.prop('checked')) changed = false + if (!$input.prop('checked') || !this.$element.hasClass('active')) $parent.find('.active').removeClass('active') } if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') } else { @@ -107,7 +107,7 @@ var $btn = $(e.target) if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') Plugin.call($btn, 'toggle') - e.preventDefault() + if (!$(e.target).is('input[type="radio"]')) e.preventDefault() }) .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) |
