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

github.com/twbs/bootstrap-sass.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2013-11-14 06:38:32 +0400
committerGleb Mazovetskiy <glex.spb@gmail.com>2013-11-14 21:28:03 +0400
commit263dc713ff89de6f5784e8cfd0d22aa2bc2aaef0 (patch)
tree1de669ed58bb95ef951925529698cb9946db0e93 /vendor/assets/javascripts/bootstrap
parentefab96f854dc8b08d46297b9af313fbe815124ac (diff)
rake convert
Diffstat (limited to 'vendor/assets/javascripts/bootstrap')
-rw-r--r--vendor/assets/javascripts/bootstrap/button.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/vendor/assets/javascripts/bootstrap/button.js b/vendor/assets/javascripts/bootstrap/button.js
index 0145689d..3c161350 100644
--- a/vendor/assets/javascripts/bootstrap/button.js
+++ b/vendor/assets/javascripts/bootstrap/button.js
@@ -54,15 +54,21 @@
Button.prototype.toggle = function () {
var $parent = this.$element.closest('[data-toggle="buttons"]')
+ var changed = true
if ($parent.length) {
var $input = this.$element.find('input')
- .prop('checked', !this.$element.hasClass('active'))
- .trigger('change')
- if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
+ if ($input.prop('type') === 'radio') {
+ // see if clicking on current one
+ if ($input.prop('checked') && this.$element.hasClass('active'))
+ changed = false
+ else
+ $parent.find('.active').removeClass('active')
+ }
+ if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
}
- this.$element.toggleClass('active')
+ if (changed) this.$element.toggleClass('active')
}