2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00

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.
This commit is contained in:
Patrick H. Lauke
2014-10-17 15:17:57 +01:00
committed by Heinrich Fenkart
parent 60bb69acd5
commit e1d40f7633
3 changed files with 27 additions and 3 deletions
+2
View File
@@ -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')