0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

add role="button" to a[data-toggle="collapse"]; fixes #15972

This commit is contained in:
Chris Rebert 2015-03-03 13:18:36 -08:00
parent 168297c779
commit cc39f5c52d
4 changed files with 39 additions and 39 deletions

View File

@ -19,7 +19,7 @@
<div class="bs-example"> <div class="bs-example">
<p> <p>
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> <a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Link with href Link with href
</a> </a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
@ -33,7 +33,7 @@
</div> </div>
</div> </div>
{% highlight html %} {% highlight html %}
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> <a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Link with href Link with href
</a> </a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"> <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
@ -54,7 +54,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne"> <div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1 Collapsible Group Item #1
</a> </a>
</h4> </h4>
@ -68,7 +68,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo"> <div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2 Collapsible Group Item #2
</a> </a>
</h4> </h4>
@ -82,7 +82,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree"> <div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3 Collapsible Group Item #3
</a> </a>
</h4> </h4>
@ -100,7 +100,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne"> <div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1 Collapsible Group Item #1
</a> </a>
</h4> </h4>
@ -114,7 +114,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo"> <div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2 Collapsible Group Item #2
</a> </a>
</h4> </h4>
@ -128,7 +128,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree"> <div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3 Collapsible Group Item #3
</a> </a>
</h4> </h4>
@ -148,7 +148,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="collapseListGroupHeading1"> <div class="panel-heading" role="tab" id="collapseListGroupHeading1">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" href="#collapseListGroup1" aria-expanded="false" aria-controls="collapseListGroup1"> <a class="collapsed" role="button" data-toggle="collapse" href="#collapseListGroup1" aria-expanded="false" aria-controls="collapseListGroup1">
Collapsible list group Collapsible list group
</a> </a>
</h4> </h4>

View File

@ -83,7 +83,7 @@ $(function () {
assert.expect(1) assert.expect(1)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1"/>') $('<div id="test1"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -99,7 +99,7 @@ $(function () {
assert.expect(1) assert.expect(1)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="in"/>') $('<div id="test1" class="in"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -115,8 +115,8 @@ $(function () {
assert.expect(2) assert.expect(2)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture')
var $alt = $('<a data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') var $alt = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1"/>') $('<div id="test1"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -133,8 +133,8 @@ $(function () {
assert.expect(2) assert.expect(2)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
var $alt = $('<a data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $alt = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="in"/>') $('<div id="test1" class="in"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -188,15 +188,15 @@ $(function () {
+ '</div>' + '</div>'
var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel') var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel')
var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0))
$('<div id="body1" class="in"/>').appendTo($groups.eq(0)) $('<div id="body1" class="in"/>').appendTo($groups.eq(0))
var $target2 = $('<a class="collapsed" data-toggle="collapse" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1)) var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1))
$('<div id="body2"/>').appendTo($groups.eq(1)) $('<div id="body2"/>').appendTo($groups.eq(1))
var $target3 = $('<a class="collapsed" data-toggle="collapse" href="#body3" data-parent="#accordion"/>').appendTo($groups.eq(2)) var $target3 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body3" data-parent="#accordion"/>').appendTo($groups.eq(2))
$('<div id="body3"/>') $('<div id="body3"/>')
.appendTo($groups.eq(2)) .appendTo($groups.eq(2))
@ -222,15 +222,15 @@ $(function () {
+ '</div>' + '</div>'
var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel') var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel')
var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent=".accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent=".accordion"/>').appendTo($groups.eq(0))
$('<div id="body1" class="in"/>').appendTo($groups.eq(0)) $('<div id="body1" class="in"/>').appendTo($groups.eq(0))
var $target2 = $('<a class="collapsed" data-toggle="collapse" href="#body2" data-parent=".accordion"/>').appendTo($groups.eq(1)) var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" data-parent=".accordion"/>').appendTo($groups.eq(1))
$('<div id="body2"/>').appendTo($groups.eq(1)) $('<div id="body2"/>').appendTo($groups.eq(1))
var $target3 = $('<a class="collapsed" data-toggle="collapse" href="#body3" data-parent=".accordion"/>').appendTo($groups.eq(2)) var $target3 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body3" data-parent=".accordion"/>').appendTo($groups.eq(2))
$('<div id="body3"/>') $('<div id="body3"/>')
.appendTo($groups.eq(2)) .appendTo($groups.eq(2))
@ -249,7 +249,7 @@ $(function () {
assert.expect(1) assert.expect(1)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture')
$('<div id="test1"/>') $('<div id="test1"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -265,7 +265,7 @@ $(function () {
assert.expect(1) assert.expect(1)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="in"/>') $('<div id="test1" class="in"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -281,8 +281,8 @@ $(function () {
assert.expect(2) assert.expect(2)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture')
var $alt = $('<a data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture') var $alt = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1" aria-expanded="false"/>').appendTo('#qunit-fixture')
$('<div id="test1"/>') $('<div id="test1"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -299,8 +299,8 @@ $(function () {
assert.expect(2) assert.expect(2)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture')
var $alt = $('<a data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') var $alt = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="in"/>') $('<div id="test1" class="in"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -324,15 +324,15 @@ $(function () {
+ '</div>' + '</div>'
var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel') var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel')
var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0))
$('<div id="body1" aria-expanded="true" class="in"/>').appendTo($groups.eq(0)) $('<div id="body1" aria-expanded="true" class="in"/>').appendTo($groups.eq(0))
var $target2 = $('<a class="collapsed" data-toggle="collapse" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1)) var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1))
$('<div id="body2" aria-expanded="false"/>').appendTo($groups.eq(1)) $('<div id="body2" aria-expanded="false"/>').appendTo($groups.eq(1))
var $target3 = $('<a class="collapsed" data-toggle="collapse" href="#body3" data-parent="#accordion"/>').appendTo($groups.eq(2)) var $target3 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body3" data-parent="#accordion"/>').appendTo($groups.eq(2))
$('<div id="body3" aria-expanded="false"/>') $('<div id="body3" aria-expanded="false"/>')
.appendTo($groups.eq(2)) .appendTo($groups.eq(2))
@ -358,7 +358,7 @@ $(function () {
var showFired = false var showFired = false
var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel') var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.panel')
var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0))
$('<div id="body1" class="collapse"/>') $('<div id="body1" class="collapse"/>')
.appendTo($groups.eq(0)) .appendTo($groups.eq(0))
@ -366,7 +366,7 @@ $(function () {
showFired = true showFired = true
}) })
var $target2 = $('<a data-toggle="collapse" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1)) var $target2 = $('<a role="button" data-toggle="collapse" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1))
var $body2 = $('<div id="body2" class="collapse"/>').appendTo($groups.eq(1)) var $body2 = $('<div id="body2" class="collapse"/>').appendTo($groups.eq(1))
$target2.click() $target2.click()
@ -387,7 +387,7 @@ $(function () {
assert.expect(1) assert.expect(1)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="in"/>') $('<div id="test1" class="in"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
@ -402,7 +402,7 @@ $(function () {
assert.expect(1) assert.expect(1)
var done = assert.async() var done = assert.async()
var $target = $('<a data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" class="collapsed" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1"/>') $('<div id="test1"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')

View File

@ -26,7 +26,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
Collapsible Group Item #1 Collapsible Group Item #1
</a> </a>
</h4> </h4>
@ -40,7 +40,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
Collapsible Group Item #2 Collapsible Group Item #2
</a> </a>
</h4> </h4>
@ -54,7 +54,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseThree"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
Collapsible Group Item #3 Collapsible Group Item #3
</a> </a>
</h4> </h4>

View File

@ -44,7 +44,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne"> <div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1 Collapsible Group Item #1
</a> </a>
</h4> </h4>
@ -58,7 +58,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo"> <div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2 Collapsible Group Item #2
</a> </a>
</h4> </h4>