Moved doFancyExpensiveTabThings into the Skeleton namespace, and added support for multiple tab sets.
This commit is contained in:
parent
553f2fa375
commit
89d54a83f2
@ -99,17 +99,16 @@
|
|||||||
var event = e || window.event;
|
var event = e || window.event;
|
||||||
return fn.call(element, event); //Force it to call the handler in the proper context (IE 7 & 8 do not)
|
return fn.call(element, event); //Force it to call the handler in the proper context (IE 7 & 8 do not)
|
||||||
}, last);
|
}, last);
|
||||||
}
|
},
|
||||||
};
|
|
||||||
|
|
||||||
window.Skeleton = Skeleton;
|
doFancyExpensiveTabThings : function(){
|
||||||
})();
|
|
||||||
|
|
||||||
function doFancyExpensiveTabThings(){
|
|
||||||
var tabs = Skeleton.filterTags(Skeleton.getElementsByClassName(document, "tabs"), ["ul"]);
|
var tabs = Skeleton.filterTags(Skeleton.getElementsByClassName(document, "tabs"), ["ul"]);
|
||||||
|
|
||||||
for(var i = 0, j = tabs.length; i < j; i++){
|
for(var i = 0, j = tabs.length; i < j; i++){
|
||||||
var tabList = tabs[i].getElementsByTagName("li");
|
(function(){
|
||||||
|
var tabNum = i,
|
||||||
|
tabList = tabs[tabNum].getElementsByTagName("li");
|
||||||
|
|
||||||
for(var k = 0, l = tabList.length; k < l; k++){
|
for(var k = 0, l = tabList.length; k < l; k++){
|
||||||
Skeleton.addListener(tabList[k].getElementsByTagName('a')[0], "click", function(e){
|
Skeleton.addListener(tabList[k].getElementsByTagName('a')[0], "click", function(e){
|
||||||
var contentLocation = this.href.substr(this.href.indexOf("#")) + "Tab",
|
var contentLocation = this.href.substr(this.href.indexOf("#")) + "Tab",
|
||||||
@ -130,7 +129,8 @@ function doFancyExpensiveTabThings(){
|
|||||||
|
|
||||||
Skeleton.addClass(this, "active");
|
Skeleton.addClass(this, "active");
|
||||||
|
|
||||||
contentElement = document.getElementById(contentLocation.substr(1));
|
//contentElement = document.getElementById(contentLocation.substr(1));
|
||||||
|
contentElement = Skeleton.getElementsByClassName(Skeleton.getElementsByClassName(tabs[tabNum].parentNode, "tabs-content")[0], contentLocation.substr(1))[0];
|
||||||
Skeleton.addClass(contentElement, "active");
|
Skeleton.addClass(contentElement, "active");
|
||||||
|
|
||||||
siblings = contentElement.parentNode.getElementsByTagName('li');
|
siblings = contentElement.parentNode.getElementsByTagName('li');
|
||||||
@ -143,7 +143,12 @@ function doFancyExpensiveTabThings(){
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Skeleton.addListener(window, "load", doFancyExpensiveTabThings);
|
window.Skeleton = Skeleton;
|
||||||
|
})();
|
||||||
|
|
||||||
|
Skeleton.addListener(window, "load", Skeleton.doFancyExpensiveTabThings);
|
Loading…
Reference in New Issue
Block a user