@ -263,6 +263,9 @@ $.fn.tab = function(parameters) {
} ,
set : {
activeTab ( $tab ) {
} ,
auto : function ( ) {
var
url = ( typeof settings . path == 'string' )
@ -508,15 +511,19 @@ $.fn.tab = function(parameters) {
} ,
tab : function ( tabPath ) {
var
$tab = module . get . tabElement ( tabPath ) ,
isActive = $tab . hasClass ( className . active )
$tab = module . get . tabElement ( tabPath ) ,
$deactiveTabs = ( settings . deactivate == 'siblings' )
? $tab . siblings ( $tabs )
: $tabs . not ( $tab ) ,
isActive = $tab . hasClass ( className . active )
;
module . verbose ( 'Showing tab content for' , $tab ) ;
if ( ! isActive ) {
$tab
. addClass ( className . active )
. siblings ( $tabs )
. removeClass ( className . active + ' ' + className . loading )
;
$deactiveTabs
. removeClass ( className . active + ' ' + className . loading )
;
if ( $tab . length > 0 ) {
settings . onVisible . call ( $tab [ 0 ] , tabPath ) ;
@ -525,15 +532,19 @@ $.fn.tab = function(parameters) {
} ,
navigation : function ( tabPath ) {
var
$navigation = module . get . navElement ( tabPath ) ,
$navigation = module . get . navElement ( tabPath ) ,
$deactiveNavigation = ( settings . deactivate == 'siblings' )
? $navigation . siblings ( $allModules )
: $allModules . not ( $navigation ) ,
isActive = $navigation . hasClass ( className . active )
;
module . verbose ( 'Activating tab navigation for' , $navigation , tabPath ) ;
if ( ! isActive ) {
$navigation
. addClass ( className . active )
. siblings ( $allModules )
. removeClass ( className . active + ' ' + className . loading )
;
$deactiveNavigation
. removeClass ( className . active + ' ' + className . loading )
;
}
}
@ -840,28 +851,30 @@ $.fn.tab.settings = {
verbose : false ,
performance : true ,
auto : false , // uses pjax style endpoints fetching content from same url with remote-content headers
history : false , // use browser history
historyType : 'hash' , // #/ or html5 state
path : false , // base path of url
auto : false , // uses pjax style endpoints fetching content from same url with remote-content headers
history : false , // use browser history
historyType : 'hash' , // #/ or html5 state
path : false , // base path of url
context : false , // specify a context that tabs must appear inside
childrenOnly : false , // use only tabs that are children of context
maxDepth : 25 , // max depth a tab can be nested
context : false , // specify a context that tabs must appear inside
childrenOnly : false , // use only tabs that are children of context
maxDepth : 25 , // max depth a tab can be nested
deactivate : 'siblings' , // whether tabs should deactivate sibling menu elements or all elements initialized together
alwaysRefresh : false , // load tab content new every tab click
cache : true , // cache the content requests to pull locally
ignoreFirstLoad : false , // don't load remote content on first load
alwaysRefresh : false , // load tab content new every tab click
cache : true , // cache the content requests to pull locally
ignoreFirstLoad : false , // don't load remote content on first load
apiSettings : false , // settings for api call
evaluateScripts : 'once' , // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
apiSettings : false , // settings for api call
evaluateScripts : 'once' , // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
onFirstLoad : function ( tabPath , parameterArray , historyEvent ) { } , // called first time loaded
onLoad : function ( tabPath , parameterArray , historyEvent ) { } , // called on every load
onVisible : function ( tabPath , parameterArray , historyEvent ) { } , // called every time tab visible
onRequest : function ( tabPath , parameterArray , historyEvent ) { } , // called ever time a tab beings loading remote content
templates : {
templates : {
determineTitle : function ( tabArray ) { } // returns page title for path
} ,