diff options
| author | Patrick H. Lauke <[email protected]> | 2014-10-17 15:17:57 +0100 |
|---|---|---|
| committer | Heinrich Fenkart <[email protected]> | 2014-10-22 21:02:19 +0200 |
| commit | e1d40f7633886298a9fb417ed4f118844ed83a0d (patch) | |
| tree | 7068561317d1d213ddfe43660ed8fd3982193bcd /js/button.js | |
| parent | 60bb69acd512d3d54fc388823f9946cd0d350f6f (diff) | |
| download | bootstrap-e1d40f7633886298a9fb417ed4f118844ed83a0d.tar.xz bootstrap-e1d40f7633886298a9fb417ed4f118844ed83a0d.zip | |
Add `aria-pressed` to single toggle buttons
also includes tiny fix/clarification to two existing unit tests for the
.active class, adding data-toggle=“button” explicitly to the tested
buttons
Closes #14819.
Diffstat (limited to 'js/button.js')
| -rw-r--r-- | js/button.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/js/button.js b/js/button.js index b3e944c59..901e47a6e 100644 --- a/js/button.js +++ b/js/button.js @@ -60,6 +60,8 @@ else $parent.find('.active').removeClass('active') } if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } else { + this.$element.attr('aria-pressed', !this.$element.hasClass('active')) } if (changed) this.$element.toggleClass('active') |
