Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
added support for nested elements within a tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Gustafson authored and Aaron Gustafson committed Apr 20, 2009
1 parent 55638b4 commit ee26a28
Showing 2 changed files with 20 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
*v0.4.1* (2009-04-20)

* added support for nested elements within a tab

--

*v0.4* (2009-04-20)

* added support for ARIA Roles and States
19 changes: 14 additions & 5 deletions src/TabInterface.js
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@
Function: TabInterface()
Author: Aaron Gustafson (aaron at easy-designs dot net)
Creation Date: 7 December 2006
Version: 0.4
Version: 0.4.1
Homepage: http://github.com/easy-designs/tabinterface.js
License: MIT License (see MIT-LICENSE)
Note: If you change or improve on this script, please let us know by
emailing the author (above) with a link to your demo page.
------------------------------------------------------------------------------*/
function TabInterface( el, i ){
// Public Properties
this.Version = '0.4'; // version
this.Version = '0.4.1'; // version

// Private Properties
var _i = i; // incrementor
@@ -110,9 +110,9 @@ function TabInterface( el, i ){
function swap( e )
{
e = ( e ) ? e : event;
var tab = e.target || e.srcElement,
old_folder = document.getElementById( _active ),
new_folder = document.getElementById( tab.folder );
var tab = e.target || e.srcElement, old_folder = document.getElementById( _active );
tab = getTab( tab );
var new_folder = document.getElementById( tab.folder );
removeClassName( document.getElementById( _active + '-tab' ), 'active-tab' );
removeClassName( old_folder, 'visible' );
old_folder.setAttribute( 'aria-hidden', 'true' );
@@ -135,13 +135,22 @@ function TabInterface( el, i ){
}
e.className = classes.join( ' ' );
}
function getTab( tab )
{
while ( tab.nodeName.toLowerCase() != 'li' )
{
tab = tab.parentNode;
}
return tab;
}
function moveFocus( e )
{
e = ( e ) ? e : event;
var
tab = e.target || e.srcElement,
key = e.keyCode || e.charCode,
pass = true;
tab = getTab( tab );
switch ( key )
{
case 37: // left arrow

0 comments on commit ee26a28

Please sign in to comment.