Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glebm@google.com>2015-04-27 11:59:39 +0300
committerGleb Mazovetskiy <glebm@google.com>2015-04-27 11:59:39 +0300
commitf95e617f9d165c85a7d9fe658f56b53c5b756dcb (patch)
tree1a5b728c2153985adf4d60ef4c9bed7d8ee847d6 /assets/javascripts/bootstrap/button.js
parent4d879df2cb2dd4ef6dc72478a1a389d5f60a45f6 (diff)
rake convert
Diffstat (limited to 'assets/javascripts/bootstrap/button.js')
-rw-r--r--assets/javascripts/bootstrap/button.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/assets/javascripts/bootstrap/button.js b/assets/javascripts/bootstrap/button.js
index 7c7c021..3b86f35 100644
--- a/assets/javascripts/bootstrap/button.js
+++ b/assets/javascripts/bootstrap/button.js
@@ -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))