silverstripe-framework/javascript/TabSet.js
Ingo Schommer 7856df5f37 ENHANCEMENT Using jQuery UI and "concrete" tabs for Security/login with multiple authentication methods (e.g. CMS-login and OpenID)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92484 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-21 02:22:49 +00:00

18 lines
551 B
JavaScript

jQuery(document).ready(function () {
/**
* Replace prefixes for all hashlinks in tabs.
* SSViewer rewrites them from "#Root_MyTab" to
* e.g. "/admin/#Root_MyTab" which makes them
* unusable for jQuery UI.
*/
jQuery('.ss-tabset > ul a').each(function() {
var href = jQuery(this).attr('href').replace(/.*(#.*)/, '$1');
jQuery(this).attr('href', href);
})
// Initialize tabset
jQuery('.ss-tabset').tabs();
// if tab has no nested tabs, set overflow to auto
jQuery('.ss-tabset .tab').not(':has(.tab)').css('overflow', 'auto');
});