Skip to content

Commit

Permalink
Changelog:
Browse files Browse the repository at this point in the history
* V4 fixed missing `aria-selected` from Tab #254
* V3 fixed missing `aria-expanded` from Tab #254
* further updates for #253
* documentation fixes and updates
  • Loading branch information
thednp committed Dec 3, 2018
1 parent 36f9798 commit ec1f23c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
4 changes: 3 additions & 1 deletion assets/css/theme4.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ h3:not(.popover-header) {
.bg-bootstrap { background-color: #563d7c }
.bg-pink { background-color: #E91E63 }
.bg-indigo { background-color: #9c27b0 }


/* SVG icons */
.nav svg {vertical-align: text-top;}
9 changes: 5 additions & 4 deletions dist/bootstrap-native-v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

// option keys
backdrop = 'backdrop', keyboard = 'keyboard', delay = 'delay',
content = 'content', target = 'target',
content = 'content', target = 'target', currentTarget = 'currentTarget',
interval = 'interval', pause = 'pause', animation = 'animation',
placement = 'placement', container = 'container',

Expand All @@ -89,6 +89,7 @@
// aria
ariaExpanded = 'aria-expanded',
ariaHidden = 'aria-hidden',
ariaSelected = 'aria-selected',

// event names
clickEvent = 'click',
Expand Down Expand Up @@ -1588,10 +1589,8 @@
},
// handler
clickHandler = function(e) {
var href = e[target][getAttribute]('href');
e[preventDefault]();
next = e[target][getAttribute](dataToggle) === component || (href && href.charAt(0) === '#')
? e[target] : e[target][parentNode]; // allow for child elements like icons to use the handler
next = e[currentTarget];
!tabs[isAnimating] && !hasClass(next,active) && self.show();
};

Expand All @@ -1604,7 +1603,9 @@

tabs[isAnimating] = true;
removeClass(activeTab,active);
activeTab[setAttribute](ariaSelected,'false');
addClass(next,active);
next[setAttribute](ariaSelected,'true');

if ( dropdown ) {
if ( !hasClass(element[parentNode],'dropdown-menu') ) {
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-native-v4.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/bootstrap-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

// option keys
backdrop = 'backdrop', keyboard = 'keyboard', delay = 'delay',
content = 'content', target = 'target',
content = 'content', target = 'target', currentTarget = 'currentTarget',
interval = 'interval', pause = 'pause', animation = 'animation',
placement = 'placement', container = 'container',

Expand Down Expand Up @@ -1735,10 +1735,8 @@
},
// handler
clickHandler = function(e) {
var href = e[target][getAttribute]('href');
e[preventDefault]();
next = e[target][getAttribute](dataToggle) === component || (href && href.charAt(0) === '#')
? e[target] : e[target][parentNode]; // allow for child elements like icons to use the handler
next = e[currentTarget] || this; // IE8 needs to know who really currentTarget is
!tabs[isAnimating] && !hasClass(next[parentNode],active) && self.show();
};

Expand All @@ -1751,7 +1749,9 @@

tabs[isAnimating] = true;
removeClass(activeTab[parentNode],active);
activeTab[setAttribute](ariaExpanded,'false');
addClass(next[parentNode],active);
next[setAttribute](ariaExpanded,'true');

if ( dropdown ) {
if ( !hasClass(element[parentNode][parentNode],'dropdown-menu') ) {
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-native.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1427,8 +1427,12 @@ <h4>Example</h4>
<p>OK now we're ready to put this component to the test. We'll use all Bootstrap <code>.nav</code> components in the pool.</p>

<ul id="myTab" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" id="home-tab" role="tab" data-height="true" data-toggle="tab" aria-controls="home" aria-expanded="true"><i class="glyphicon glyphicon-minus-sign"></i> Home</a></li>
<li role="presentation"><a href="#profile" role="tab" id="profile-tab" data-height="true" data-toggle="tab" aria-controls="profile">Profile</a></li>
<li role="presentation" class="active"><a href="#home" id="home-tab" role="tab" data-height="true" data-toggle="tab" aria-controls="home" aria-expanded="true"><i class="glyphicon glyphicon-home"></i> Home</a></li>
<li role="presentation"><a href="#profile" role="tab" id="profile-tab" data-height="true" data-toggle="tab" aria-controls="profile">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="14px" height="14px">
<path class="cursor-pointer" d="M576 706.612v-52.78c70.498-39.728 128-138.772 128-237.832 0-159.058 0-288-192-288s-192 128.942-192 288c0 99.060 57.502 198.104 128 237.832v52.78c-217.102 17.748-384 124.42-384 253.388h896c0-128.968-166.898-235.64-384-253.388z" fill="inherit" stroke="inherit" stroke-width="inherit" stroke-linejoin="inherit" stroke-linecap="inherit" stroke-miterlimit="inherit" opacity="1"></path>
</svg>
Profile</a></li>
<li role="presentation" class="dropdown">
<a href="#" id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown" data-persist="true" aria-controls="myTabDrop1-contents" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="myTabDrop1" id="myTabDrop1-contents">
Expand Down
22 changes: 16 additions & 6 deletions v4.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h2>Buttons</h2>

<h2>Carousel</h2>
<div class="bd-example" data-example-id="">
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<div id="carouselExampleIndicators" class="carousel slide carousel-fade" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1" class=""></li>
Expand Down Expand Up @@ -595,24 +595,34 @@ <h2>Tab</h2>
<div class="bd-example" role="tabpanel" style="margin-bottom: 1rem">
<ul class="nav nav-tabs" id="myTab" role="tablist" style="margin-bottom: 1rem">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" data-duration="350" data-height="true" href="#home" role="tab" aria-controls="home" aria-expanded="true">Home</a>
<a class="nav-link active" id="home-tab" data-toggle="tab" data-duration="350" data-height="true" href="#home" role="tab" aria-controls="home" aria-selected="true">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="18px" height="18px">
<path d="M1024 608l-192-192v-288h-128v160l-192-192-512 512v32h128v320h320v-192h128v192h320v-320h128z" fill="inherit" stroke="inherit" stroke-width="inherit" stroke-linejoin="inherit" stroke-linecap="inherit" stroke-miterlimit="inherit" opacity="1"></path>
</svg>
Home
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" data-duration="350" data-height="true" href="#profile" role="tab" aria-controls="profile" aria-expanded="false">Profile</a>
<a class="nav-link" id="profile-tab" data-toggle="tab" data-duration="350" data-height="true" href="#profile" role="tab" aria-controls="profile" aria-selected="false">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="18px" height="18px">
<path d="M576 706.612v-52.78c70.498-39.728 128-138.772 128-237.832 0-159.058 0-288-192-288s-192 128.942-192 288c0 99.060 57.502 198.104 128 237.832v52.78c-217.102 17.748-384 124.42-384 253.388h896c0-128.968-166.898-235.64-384-253.388z" fill="inherit" stroke="inherit" stroke-width="inherit" stroke-linejoin="inherit" stroke-linecap="inherit" stroke-miterlimit="inherit" opacity="1"></path>
</svg>
Profile
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-persist="true" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<a class="nav-link dropdown-toggle" data-persist="true" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-selected="false">Dropdown</a>
<div class="dropdown-menu">
<a class="dropdown-item" id="dropdown1-tab" href="#dropdown1" role="tab" data-toggle="tab" data-duration="350" data-height="true" aria-controls="dropdown1">@fat</a>
<a class="dropdown-item" id="dropdown2-tab" href="#dropdown2" role="tab" data-toggle="tab" data-duration="350" data-height="true" aria-controls="dropdown2">@mdo</a>
</div>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div role="tabpanel" class="tab-pane fade active show" id="home" aria-labelledby="home-tab" aria-expanded="true">
<div role="tabpanel" class="tab-pane fade active show" id="home" aria-labelledby="home-tab">
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
</div>
<div class="tab-pane fade " id="profile" role="tabpanel" aria-labelledby="profile-tab" aria-expanded="false">
<div class="tab-pane fade " id="profile" role="tabpanel" aria-labelledby="profile-tab">
<p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p>
</div>
<div class="tab-pane fade" id="dropdown1" role="tabpanel" aria-labelledby="dropdown1-tab">
Expand Down

0 comments on commit ec1f23c

Please sign in to comment.