diff options
author | Rob Cresswell <robert.cresswell@outlook.com> | 2016-08-03 11:37:29 +0100 |
---|---|---|
committer | Rob Cresswell <robert.cresswell@outlook.com> | 2016-08-03 11:38:12 +0100 |
commit | 577f0ce201e48aaf2d5fbf4d9799013eb108ffd3 (patch) | |
tree | e58169d6f731707f07138def6e088feb84559430 /xstatic/pkg/bootstrap_scss/data/js/bootstrap/button.js | |
parent | c2c9da531752185f0351548fb25810990366bd98 (diff) | |
download | xstatic-bootstrap-scss-577f0ce201e48aaf2d5fbf4d9799013eb108ffd3.tar.gz |
Update xstatic-bootstrap to 3.3.7.03.3.7.0
Also runs the new xstatic-release script to make the repo
consistent with others
Change-Id: Ib0a09017d780836a80e2ede3a0749755484a2c8f
Diffstat (limited to 'xstatic/pkg/bootstrap_scss/data/js/bootstrap/button.js')
-rw-r--r-- | xstatic/pkg/bootstrap_scss/data/js/bootstrap/button.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/xstatic/pkg/bootstrap_scss/data/js/bootstrap/button.js b/xstatic/pkg/bootstrap_scss/data/js/bootstrap/button.js index 0f36e41..843b39c 100644 --- a/xstatic/pkg/bootstrap_scss/data/js/bootstrap/button.js +++ b/xstatic/pkg/bootstrap_scss/data/js/bootstrap/button.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: button.js v3.3.6 + * Bootstrap: button.js v3.3.7 * http://getbootstrap.com/javascript/#buttons * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -19,7 +19,7 @@ this.isLoading = false } - Button.VERSION = '3.3.6' + Button.VERSION = '3.3.7' Button.DEFAULTS = { loadingText: 'loading...' @@ -41,10 +41,10 @@ if (state == 'loadingText') { this.isLoading = true - $el.addClass(d).attr(d, d) + $el.addClass(d).attr(d, d).prop(d, true) } else if (this.isLoading) { this.isLoading = false - $el.removeClass(d).removeAttr(d) + $el.removeClass(d).removeAttr(d).prop(d, false) } }, this), 0) } @@ -108,10 +108,15 @@ $(document) .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + var $btn = $(e.target).closest('.btn') Plugin.call($btn, 'toggle') - if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault() + if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { + // Prevent double click on radios, and the double selections (so cancellation) on checkboxes + e.preventDefault() + // The target component still receive the focus + if ($btn.is('input,button')) $btn.trigger('focus') + else $btn.find('input:visible,button:visible').first().trigger('focus') + } }) .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)) |